fix(docker): review follow-ups from #66 #72
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/docker-review-followups"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR fixes the two nits from the #66 approval.
releasingStreamkept the wrong errorIf the engine stream errored and
release()threw too, the release error replaced the read error. The stream still failed, but the operator saw the cleanup failure instead of its cause. The fix makes the read error the one that is reported and swallows a failed release on that path.release()already swallows its ownDELETEfailure, so nothing is lost. The new test case fails on the old code.Mixed line endings were rewritten silently
splitEolflagged a file as CRLF if it contained any CRLF. A mixed file was then saved as all-CRLF, and the preview did not show that change, because both sides were normalised. The fix restores endings line by line:splitEolnow returnscrlf: boolean[] | null, one flag per line (nullfor an LF-only file).joinEol(original, text, crlf)diffs the text against the loaded original. A kept line gets its old ending. A new or edited line gets the ending most of the file uses.FileEditorrecomputes the flags from what it saved, so a second save in the same dialog diffs against the right baseline.Result: a mixed file gets back exactly what the preview shows. A pure CRLF file or a pure LF file behaves as before. If the diff is over
DIFF_LINE_LIMIT, every line gets the majority ending, which is the old behaviour.Not in here
replaceFile/hostPathsymlink resolution should-fix. It affects every host-path read and not only this write, so it is filed as #71.self-update-rollback-digest.shrig scenario has still not been run.Checks
deno fmt --check,deno lint,deno task check: clean.check:svelte: 0 errors.deno task test: 1040 passed, 0 failed, 1 ignored.🤖 Generated with Claude Code
Both follow-ups look correct. The tests pass locally: 8 in
diff_test.tsand 14 involume_archive_test.ts.releasingStream: The read error now wins, and a failed release is swallowed only on that path. The success path still awaitsonce()afterclose(), as before. The cancel path is unchanged.Per-line EOL: I traced the indexing.
splitEoldrops the final segment, socrlf[i]lines up with the full-split indices thatdiffLinesuses.diffLinesreturns every line with no hunk collapsing, so thei/jwalk injoinEolstays aligned. The last line gets no ending, so a missing trailing newline round-trips. A trailing lone\rsurvives because only\r\nis normalised. OverDIFF_LINE_LIMIT,diffLinesreturns null, so every line gets the majority ending, which matches the old behaviour. Recomputingcrlffrom the savedcontentgives the correct baseline for a second save.Non-blocking nit: LCS pairs lines by text. In a mixed file, a line that appears more than once (
}, blank lines) can be matched to a different original copy of itself and take that copy's ending. For example, if two blank lines have different endings and one of them is deleted, the survivor may get the other one's ending. This is rare, and the result is still no worse than the old all-or-nothing behaviour. No change is needed unless it shows up in practice.Please re-sign the commits before merging, as the description says.
a1cc68a4a8d3520fe872Force-pushed to sign both commits. The tree is identical.
b24d230→88ad0fd,a1cc68a→d3520fe.