Skip to content

Refresh file info counter after deleting a file#6841

Open
dev-null-life wants to merge 1 commit intostashapp:developfrom
dev-null-life:fix/file-info-counter-stale-on-delete
Open

Refresh file info counter after deleting a file#6841
dev-null-life wants to merge 1 commit intostashapp:developfrom
dev-null-life:fix/file-info-counter-stale-on-delete

Conversation

@dev-null-life
Copy link
Copy Markdown
Contributor

Summary

The "File Info" counter on Scene, Image, and Gallery detail pages did not update after deleting a file — users had to manually refresh to see the new count.

The Apollo update handler in mutateDeleteFiles was evicting the plural list queries (findScenes, findImages, findGalleries) and the file objects themselves, but not the singular detail queries (findScene, findImage, findGallery) that drive the counters on the detail pages. Adding those to the evictQueries list triggers a refetch next time the detail page reads the cache.

Test plan

  • Open a scene with multiple files, delete one via the File Info panel — counter in the nav tab updates without a page refresh.
  • Same for an image with multiple visual files.
  • Same for a gallery with multiple files.
  • Scene / image / gallery list pages still reflect the change.

The mutateDeleteFiles Apollo cache update evicted the plural list
queries (findScenes/findImages/findGalleries) but not the singular
detail queries, so the "File Info" counter on a scene/image/gallery
detail page stayed stale until a manual refresh.
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.

1 participant