Skip to content

🐛(frontend) refresh the Recent view after item mutations#766

Open
maartendra wants to merge 1 commit into
suitenumerique:mainfrom
maartendra:fix/refresh-recent-view
Open

🐛(frontend) refresh the Recent view after item mutations#766
maartendra wants to merge 1 commit into
suitenumerique:mainfrom
maartendra:fix/refresh-recent-view

Conversation

@maartendra

Copy link
Copy Markdown

Bug

A mutation performed while viewing the Recent page does not refresh the list — a newly created / converted / renamed / deleted item only shows up after a manual page reload. Other views (My files, Shared, Favorites) refresh correctly.

Cause

useGetQueryKeyToRefresh returns ["items", "infinite"] (plus ["items", <parentId>, "children"] when a parent is known). React Query invalidation is prefix-based, so ["items", "infinite"] matches the general list views but not the Recent view, whose query key is ["items", "recent", "infinite"] (useInfiniteRecentItems). As a result no mutation ever invalidates the Recent list.

Fix

Also invalidate ["items", "recent", "infinite"] in the refresh helper.

Steps to reproduce

  1. Open the Recent view.
  2. Create a document, convert a legacy file, or delete/rename an item.
  3. Observe the list does not update until a manual reload.

With this change, Recent refreshes like the other views.

@kernicPanel
kernicPanel requested a review from NathanVss July 8, 2026 05:34
useGetQueryKeyToRefresh invalidated only ["items", "infinite"] (+ the folder
["items", <parentId>, "children"]). React Query invalidation is prefix-based,
so that matches the general list views (My files, Shared, Favorites) but not
the Recent view, whose key is ["items", "recent", "infinite"]
(useInfiniteRecentItems). As a result, a mutation performed while viewing
Recent (create, convert, delete, rename, upload) did not refresh the list
until a manual reload. Also invalidate the recent key.
@maartendra
maartendra force-pushed the fix/refresh-recent-view branch from 55c8a8b to 7cb66f5 Compare July 8, 2026 05:45
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

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