Fix directory-open/scan freezes and unresponsiveness (0.9.2) #187
No reviewers
Labels
No labels
Kind/Bug
Kind/Feature
Priority/High
Priority/Medium
Reviewed/Confirmed
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ai-collab/bulk-image-organizer!187
Loading…
Reference in a new issue
No description provided.
Delete branch "0.9.1/issue-176-178-scan-freeze"
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?
Summary
Fixes #176, #177, #178, plus two regressions found during manual re-testing on a large (15k-image) cached workspace on Windows 11.
open_directory()'s post-hydrate block (stale-type prune, DB preload, thumbnail hydrate) ran with zero_pump_ui_events()calls, so its "Preparing workspace..." status never rendered before the block's work finished — looked frozen on large workspaces. Fixed by deduping the redundantget_all_images()query, chunking the cached-thumbnail load with real progress, and pumping between stages.predict_hydrate_action()now runs off-thread so Cancel isn't stuck behind an uninterruptible syscall; Cancel Scan is live during the preload phase; the metadata-scan executor stops waiting on in-flight decodes once cancelled; redundant post-cancel work is skipped.WorkingDB.temporary_busy_timeout()(thread-local) plus a bounded retry inImageTagAssignmentCommandfixes that. The scan's hottest read path also now reuses one connection instead of reconnecting every loop iteration.processEvents()pump per chunk — on a 15k-image cached workspace this was a severe regression, worse than the bug it fixed. Moved to a backgroundCachedThumbnailLoadWorkerdelivering batches via the existingThumbnailSignalsqueue instead.ImageListModel.upsert_images()/apply_thumbnail_batch()emitted onedataChangedspanning the full min..max of a scattered batch's changed rows — near-full-model-spanning ranges, tens of times per scan, dominating main-thread cost during the "Updating Database" / "Generating Thumbnails" scan stages. Now emits per contiguous run instead.Test plan
ruff check ./ruff format --check .cleanpytestsuite: 788 passed, 1 skipped (includes new tests for every fix above, several of which were verified to actually catch their regression by temporarily reverting the fix and confirming the test fails)./scripts/smoke-ui-exit.shclean after each worker/cancel-path changepip install -e .+scripts/get-version.py --canonicalnormalizes0.9.2correctly./scripts/build-linux-nuitka-smoke.shpackages and verifies cleanly🤖 Generated with Claude Code
https://claude.ai/code/session_01TrNqVfQQpmRfwhoUkKkkiJ