Repository navigation
fix(culling): guard stale viewer loads and serialize culling updates - #585
Conversation
|
Thanks for investigating this. The stale
With those changes, this would be a more focused and reliable fix. |
|
Thanks for the review! Both points are addressed in
|
|
Merged!, thanks for the PR! I added a small fix in Previously, the queue captured the advance settings before the write started. It now reads the latest settings when the write settles, including the originating pane. Added a regression test covering both enabling and cancelling auto-advance during an in-flight write. All five frontend tests and the build pass. Thanks for updating the PR and addressing the earlier feedback! |
Summary
Fixes culling flag changes (pick / reject / unreviewed) made in Image Viewer or the grid occasionally not persisting or reverting incorrectly:
src-tauri/src/t_cmds.rs,src-vite/src/common/api.js,src-vite/src/components/Content.vue)set_file_culling_flagnow returns an error when0rows are updated instead of returningOk(0).setFileCullingFlagrejects non-positive/non-integer IDs (e.g. collapsed group placeholders) and treats0updated rows as failure (null), withtoast.error(t('file_info.metadata_save_failed'))surfaced on failure.getFileInfoloads & serialize per-file culling writes (src-vite/src/common/cullingSync.ts,src-vite/src/views/ImageViewer.vue)getFileInfowatchers with request tokens so out-of-order responses cannot overwrite the active file info.getFileInfois still loading and preserves pending/committed culling flags across delayedgetFileInforesponses.fileIdand tracks the last confirmed DB value separately from the user's latest desired value, so if Reject succeeds and a subsequent Pick fails, the UI rolls back to Reject rather than the original Unreviewed state.Testing
node --test src-vite/tests/cullingPersistence.test.mjs(4/4pass, including serialized consecutive Reject → failed Pick rollback)pnpm build(802modules transformed)cargo test culling_persistence_tests(1 passed; 0 failed)