Skip to content

Windows: case-insensitive sidecar/rename fixes; Windows test and toolchain fixes - #1052

Merged
bflatastic merged 2 commits into
storytold:mainfrom
OneSlips:pr/windows-sidecar-fixes
Oct 13, 2026
Merged

bflatastic merged 2 commits into
storytold:mainfrom
OneSlips:pr/windows-sidecar-fixes

Conversation

@OneSlips

Copy link
Copy Markdown
Contributor

Split out of #1012 at a reviewer's request.

What and why

On clean main, 20 engine tests failed on Windows. Most came from three real bugs that affect any case-insensitive volume (Windows, and macOS APFS by default):

  • Sidecar spelling on rename. Renaming a photo looked for a.XMP before a.xmp. On a case-insensitive volume the upper-case spelling "exists" even when only a.xmp is on disk, so the sidecar was moved as Trip.XMP and its retained-packet record was stored under the wrong spelling. Upper-case candidates are now used only when the folder lists that exact name (new MoveFs::listed).
  • same_file symmetry. On Windows, RealFs::same_file (std has no file id there) gave different answers depending on argument order: same_file("Trip.XMP", "Trip.xmp") was false when Trip.xmp was the real entry, so saving after a partial rename reported a collision that wasn't there. It is now symmetric. It also requires the two names to differ only by case, because before this two different files with the same size and mtime counted as "the same".
  • Save spelling. Saving metadata chose the sidecar spelling with is_file(), trying lower case first, so the atomic write renamed an existing Trip.XMP to Trip.xmp. Whichever spelling the folder lists now wins.

The remaining failures came from test fixtures that wrote paths with / (FakeFs fault paths, catalog paths, expected paths), while the code joins paths with the host separator.

Small Windows and toolchain fixes, in a second commit:

  • apps/lightcraft/src/editors.rs desktop_exec: a freedesktop Exec path counts as absolute when it starts with / on every platform. Path::is_absolute expects a drive letter on Windows, so editors::tests::desktop_entries_give_their_program failed there.
  • crates/pipeline/src/spots.rs fill_box: as_chunks::<3>() instead of chunks_exact(3) (clippy::chunks_exact_to_as_chunks on newer toolchains).
  • crates/catalog/src/lock.rs descriptor_copy: now #[cfg(all(test, unix))]. Its only test is Unix-only, so on Windows it was dead code.

Linux behaviour is unchanged.

Tests

  • New regression tests: case_insensitive_renames_keep_each_sidecars_spelling (FakeFs, runs on every platform, fails without the fix) and same_file_spellings_are_symmetric_on_windows.
  • Windows 11: cargo xtask ci passes all 8 steps (fmt, clippy, heif, test, parity, layers, assets, wasm), with no retries needed.

🤖 Generated with Claude Code

OneSlips and others added 2 commits October 12, 2026 02:31
…me/sidecar tests

20 engine tests failed on Windows on clean main. Three real bugs on
case-insensitive volumes (Windows, default macOS APFS) caused most of them:

- Renaming a photo probed `a.XMP` before `a.xmp`. On a case-insensitive
  volume the upper-case spelling "exists" when only `a.xmp` is there, so the
  sidecar was moved as `Trip.XMP` (and its retained-packet record was taken
  under the wrong spelling). Upper-case candidates are now used only when the
  folder lists them exactly (new `MoveFs::listed`).
- `RealFs::same_file` on Windows (no file id in std) depended on argument
  order: `same_file("Trip.XMP", "Trip.xmp")` was false when `Trip.xmp` is the
  real entry, so saving after a partial rename reported a phantom collision.
  It is now symmetric, and also requires the names to differ only by case
  (two different files with equal size and mtime were "the same").
- Saving metadata picked the sidecar spelling by `is_file()`, lower case
  first, so the atomic write renamed an existing `Trip.XMP` to `Trip.xmp`.
  The spelling the folder lists now wins.

The rest were fixtures: FakeFs fault paths, catalog paths and expected
paths spelled with `/` while the code joins with the host separator.

Regression tests: case_insensitive_renames_keep_each_sidecars_spelling
(FakeFs, every platform; fails without the fix) and
same_file_spellings_are_symmetric_on_windows. Linux behaviour unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
desktop_exec treats a freedesktop Exec path as absolute when it starts
with '/' on every platform (Path::is_absolute wants a drive letter on
Windows); fill_box uses as_chunks (clippy::chunks_exact_to_as_chunks);
LibraryLock::descriptor_copy is cfg(all(test, unix)) like its only test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@snofla

snofla commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Cross-check from macOS (case-insensitive APFS, rustc 1.99.0, Apple silicon): I ran the original, unmodified sidecar::tests_repair tests at this PR's head (6c79be91, on main 76b53778). All ten pass, including the ones that fail on macOS today (#989 item 3). The only failure left in that group is tests_lightroom_folder::odd_folders_never_fail_the_check (APFS refuses non-UTF-8 names; #1003).

This PR also fixes what I filed as #1006 (the sidecar a.xmp becoming Trip.XMP on rename).

Two overlaps with my open PRs: the spots.rs line here is the same fix as #997 (as_chunks::<3>(), #989 item 4), and #1007 (a test-side fix for the same ten tests) is not needed with this change and touches the same assertion in tests_repair_saves.rs. Whichever lands first, the other needs a trivial rebase; I will rebase mine, or close #1007, whichever you prefer.

🤖 Generated with Claude Code

THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Oct 11, 2026
…platforms

ci.yml exists, but main does not pass it yet. The storytold#989 fixes and the
Windows ones (storytold#1052) are still outstanding, so the entry stays open:
6-12 h -> 2-4 h. Headline numbers are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Oct 11, 2026
…platforms

ci.yml exists, but main does not pass it yet. The storytold#989 fixes and the
Windows ones (storytold#1052) are still outstanding, so the entry stays open:
6-12 h -> 2-4 h. Headline numbers are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Oct 11, 2026
…platforms

ci.yml exists, but main does not pass it yet. The storytold#989 fixes and the
Windows ones (storytold#1052) are still outstanding, so the entry stays open:
6-12 h -> 2-4 h. Headline numbers are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bflatastic
bflatastic merged commit 035c378 into storytold:main Oct 13, 2026
@bflatastic

Copy link
Copy Markdown
Member

Landed on main in #1431. Thank you, @OneSlips! If you haven't already, come and join us on Discord: https://discord.gg/artcraft


Generated by Claude Code

Clearfall added a commit to Clearfall/lightcraft that referenced this pull request Oct 13, 2026
…ching

Prefer real library entries when importing browsed copies and track promoted hashes across scan and background-import batches. Add synthetic regressions for permanent deletion, restart, trash restoration, and duplicate promotion.

Draft validation on the previous base: 59 import tests passed; all 8 cargo xtask ci steps passed with PR storytold#1052 in a temporary validation worktree. Rebased onto main 68c9240, which includes storytold#1052; validation of this base is recorded in the PR.

Co-authored-by: Codex <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants