Repository navigation
A refused Lightroom photo with id 0 no longer skips every master - #4072
THEtheChad wants to merge 1 commit into
Conversation
`masterImage` is 0 for every master, so when a catalog image whose original is refused has `id_local` 0 (a malformed or crafted catalog), the refused-master check in `apply_prepared` matched every master and skipped it. Originals on disk were still added by the file import, but without their Lightroom rating, flag, edits, keywords or collection membership; offline masters got no record; a virtual copy of a skipped master failed the import with "virtual copy N: missing master", leaving the bare file records behind. The reader warns about the refused photo, but nothing warned about the photos that were skipped. The check now skips 0, as `refuse_non_media` already does. Tests cover the id-0 case with and without a virtual copy, and a virtual copy of a refused original with a path of its own, which is still refused.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…itself Adapted from upstream #4072 (cherry picked from commit 63106dbf57e749011ca70406affda8bcb8f9cfda); the fork's tests live inline in lightroom_catalog.rs, so they were ported there. Co-authored-by: THEtheChad <THEtheChad@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
vangel76
left a comment
There was a problem hiding this comment.
Reviewed 63106dbf. No findings. I traced the refused-ID guard through original and virtual-copy mapping and checked the zero sentinel and genuinely refused master cases.
Source review only. I did not build the project, run tests, or check CI.
wanikhawar
left a comment
There was a problem hiding this comment.
Looks right. masterImage is 0 for every master, so master != 0 is the correct guard, and it matches the one refuse_non_media already has in the same file. The tests cover id 0 with and without a virtual copy, plus a copy of a refused original.
Merge note: #3142 and #1735 carry the same guard, so whichever lands second drops the duplicate hunk.
I'm tracking this for v0.22.1 in #4964.
Fixes #4071
Problem
In a Lightroom catalog whose refused image (for example, an original on another computer) has
id_local0, which takes a malformed or crafted catalog,apply_prepared(crates/engine/src/lightroom_catalog.rs) skips every master. Originals on disk import as bare records without rating, flag, edits, keywords or collections; offline ones get no record; a virtual copy fails the import withvirtual copy N: missing master. Nothing warns about the skipped photos.The check skipped a photo whose
masterImageis a refused id, andmasterImageis 0 for every master.Change
master != 0), asrefuse_non_mediain the same file already does, with a comment saying why.Tests
In
crates/engine/src/lightroom_catalog/tests.rs:a_refused_photo_with_id_zero_refuses_only_itselfanda_refused_photo_with_id_zero_leaves_other_virtual_copies_their_masterfail with only the guard reverted (nothing imported;virtual copy 2: missing master) and pass with it.a_virtual_copy_of_a_refused_original_is_refused_with_itcovers the other side of the guard; it fails with the clause removed entirely.cargo xtask cion this branch (base e9c29e2): all 9 steps passed.cargo test -p lightcraft-engine --lib: 1659 passed.main27b755a:cargo test -p lightcraft-engine --lib -- lightroom_catalog(59) passes.lightcraft-cliimporting a crafted catalog: with the fix, ratings, pick and the virtual copy come through; with the guard reverted they don't. The desktop app was not run.Notes