Skip to content

Merge Develop into Main#38

Merged
SiegfriedBz merged 2 commits into
mainfrom
develop
Apr 26, 2026
Merged

Merge Develop into Main#38
SiegfriedBz merged 2 commits into
mainfrom
develop

Conversation

@SiegfriedBz
Copy link
Copy Markdown
Owner

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.

…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.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bio-verify-ai-dapp Ready Ready Preview, Comment Apr 26, 2026 1:13pm

@SiegfriedBz SiegfriedBz merged commit c6e4f34 into main Apr 26, 2026
4 checks passed
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