Merge Develop into Main#38
Merged
Merged
Conversation
…realtime-wss-stats feat(fe): keep publications list and stats in sync via layout WebSocket and query tuning ## Summary Fixes stale UI on `/publications` when users navigate between submit, list, and detail views, and when another wallet submits or status changes on-chain. Global metric cards now refresh together with the table. ### Problem - `NewPublicationStatus` subscriptions lived only on the list table, so leaving `/publications` dropped the WebSocket and missed events (e.g. submit redirect, spectator on detail). - The publications list query inherited a 60s global staleTime, so returning to the list could show cached rows/status without refetching. - WebSocket invalidation targeted publications only; `useGlobalStats` (`statsKeys.all`) never refetched, so cards stayed stale while the table updated. - Detail polling was every 5s; with WSS driving status more often, 10s is enough for assigned reviewer events that do not emit NewPublicationStatus. ### Solution - Add `PublicationsRealtimeProvider` and wrap the publications layout so `useWatchNewPublicationStatusEvent` runs for all /publications/* routes. - Remove the duplicate hook from `publications-table-container``. - Set staleTime: 0 on `usePublications` so the list background-refetches on mount. - On debounced `NewPublicationStatus` logs, invalidateQueries for `publicationsKeys.all` and `statsKeys.all`. - Bump `usePublicationDetail` refetchInterval from 5s to 10s while non-terminal. - Update READMEs accordingly.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(fe): keep publications list and stats in sync via layout WebSocket and query tuning
Summary
Fixes stale UI on
/publicationswhen users navigate between submit, list, and detail views, and when another wallet submits or status changes on-chain. Global metric cards now refresh together with the table.Problem
NewPublicationStatussubscriptions lived only on the list table, so leaving/publicationsdropped the WebSocket and missed events (e.g. submit redirect, spectator on detail).useGlobalStats(statsKeys.all) never refetched, so cards stayed stale while the table updated.Solution
PublicationsRealtimeProviderand wrap the publications layout souseWatchNewPublicationStatusEventruns for all /publications/* routes.usePublicationsso the list background-refetches on mount.NewPublicationStatuslogs, invalidateQueries forpublicationsKeys.allandstatsKeys.all.usePublicationDetailrefetchInterval from 5s to 10s while non-terminal.