Fix network-cache resurrection on delete and Tag Filter reset race (0.9.4) #189

Merged
ValleyGeek merged 3 commits from 0.9.2/issue-185-186-network-cache-tag-filter into main 2026-08-28 20:22:20 +00:00
Member

Summary

  • Issue #185 — Close Directory and Delete Cache (and app exit with "Always delete cache when closing workspace or exiting") no longer sync the local cache back to the network share before deleting it. Both paths now remove the share's colocated cache copy instead, so a later open of the same share doesn't hydrate the discarded tags/thumbnails back in. Directory switch and exit/close without delete-cache are unchanged and still sync.
  • Issue #186 — Tag Filter now reliably resets to Settings → Tag Filter defaults on every Open Directory, including auto-open of the last directory on startup. _apply_tag_filter_defaults() now forces an immediate view refresh, and session restore takes a directory_open_pending flag (computed in main.py) so it skips restoring the persisted Tag Filter whenever an auto-open is about to run right after — removing a race against open_directory()'s own reset.

Changes

  • src/bulk_image_organizer/ui/main_window.py: _delete_share_cache_files(), _finalize_workspace_close(sync_to_share=...), _on_close_directory_and_cache(), closeEvent(), _apply_tag_filter_defaults(), restore_session_if_available() / _restore_session_state().
  • src/bulk_image_organizer/main.py: compute and pass directory_open_pending.
  • Docs: CHANGELOG.md (0.9.4), docs/DECISIONS.md (DR-015, DR-021), docs/DESIGN.md, resources/help/USER_GUIDE.md.
  • VERSION bumped 0.9.3 → 0.9.4 (compiled inputs changed).

Test plan

  • ruff check . / ruff format --check .
  • Full pytest suite (799 passed, 1 skipped)
  • New/updated tests: tests/test_pr13_config.py (close-directory/app-exit network-sync coverage, session-restore-pending coverage), tests/test_tag_filter_enhancements.py::test_open_directory_resets_tag_filter_to_defaults
  • python -m pip install -e . + scripts/get-version.py --canonical0.9.4

Fixes #185, fixes #186.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

https://claude.ai/code/session_01TrNqVfQQpmRfwhoUkKkkiJ

## Summary - **Issue #185** — Close Directory and Delete Cache (and app exit with "Always delete cache when closing workspace or exiting") no longer sync the local cache back to the network share before deleting it. Both paths now remove the share's colocated cache copy instead, so a later open of the same share doesn't hydrate the discarded tags/thumbnails back in. Directory switch and exit/close *without* delete-cache are unchanged and still sync. - **Issue #186** — Tag Filter now reliably resets to Settings → Tag Filter defaults on every Open Directory, including auto-open of the last directory on startup. `_apply_tag_filter_defaults()` now forces an immediate view refresh, and session restore takes a `directory_open_pending` flag (computed in `main.py`) so it skips restoring the persisted Tag Filter whenever an auto-open is about to run right after — removing a race against `open_directory()`'s own reset. ## Changes - `src/bulk_image_organizer/ui/main_window.py`: `_delete_share_cache_files()`, `_finalize_workspace_close(sync_to_share=...)`, `_on_close_directory_and_cache()`, `closeEvent()`, `_apply_tag_filter_defaults()`, `restore_session_if_available()` / `_restore_session_state()`. - `src/bulk_image_organizer/main.py`: compute and pass `directory_open_pending`. - Docs: `CHANGELOG.md` (0.9.4), `docs/DECISIONS.md` (DR-015, DR-021), `docs/DESIGN.md`, `resources/help/USER_GUIDE.md`. - `VERSION` bumped 0.9.3 → 0.9.4 (compiled inputs changed). ## Test plan - [x] `ruff check .` / `ruff format --check .` - [x] Full `pytest` suite (799 passed, 1 skipped) - [x] New/updated tests: `tests/test_pr13_config.py` (close-directory/app-exit network-sync coverage, session-restore-pending coverage), `tests/test_tag_filter_enhancements.py::test_open_directory_resets_tag_filter_to_defaults` - [x] `python -m pip install -e .` + `scripts/get-version.py --canonical` → `0.9.4` Fixes #185, fixes #186. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> https://claude.ai/code/session_01TrNqVfQQpmRfwhoUkKkkiJ
Close Directory and Delete Cache (and app exit with the always-delete
preference on) synced the local cache back to the network share before
deleting the local copy, so the share's .bulk_image_organizer.db was
rewritten right after the user asked to discard it -- a later open would
hydrate the discarded tags/thumbnails back in. Both paths now skip the
share sync and remove the colocated share copy instead. Directory switch
and exit/close without delete-cache are unaffected and still sync.

Fixes issue #185.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TrNqVfQQpmRfwhoUkKkkiJ
fix(ui): reset tag filter to defaults before any pending auto-open
Some checks failed
CI / lint (push) Successful in 10s
CI / build-appimage (push) Has been cancelled
CI / build-windows-exe (push) Has been cancelled
CI / appimage (push) Has been cancelled
CI / windows-exe (push) Has been cancelled
CI / test (push) Has been cancelled
28bfaf1831
_apply_tag_filter_defaults() reset the proxy and popup state but never
forced the already-rendered grid/Duplicates/Trash views to re-layout, and
session restore could apply the persisted Tag Filter (including active
tags) immediately before an auto-open (CLI --directory, or "open last
directory on startup") ran open_directory()'s own reset a moment later --
a race depending on Qt timer ordering rather than a guarantee. Session
restore now takes a directory_open_pending flag from main() and skips
restoring the Tag Filter entirely when a directory-open is about to
follow, and defaults application now refreshes the filter views directly.

Fixes issue #186.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TrNqVfQQpmRfwhoUkKkkiJ
docs: PR-prep for network-cache-delete and tag-filter-reset fixes (0.9.4)
All checks were successful
CI / lint (push) Successful in 13s
CI / test (push) Successful in 6m14s
CI / appimage (push) Successful in 15m51s
CI / build-appimage (push) Successful in 0s
CI / windows-exe (push) Successful in 14m34s
CI / build-windows-exe (push) Successful in 0s
37ef514892
Bump VERSION to the next release (compiled inputs changed on this branch),
document the network-cache-delete and tag-filter-reset fixes in the
CHANGELOG, bundled user guide, and DR-015/DR-021 decision records.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TrNqVfQQpmRfwhoUkKkkiJ
ValleyGeek deleted branch 0.9.2/issue-185-186-network-cache-tag-filter 2026-08-28 20:22:21 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ai-collab/bulk-image-organizer!189
No description provided.