You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9063e3d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(fetchium): re-subscribe TopicQuery on refetch and invalidate
Adds an optional `QueryAdapter.invalidate(ctx)` lifecycle method that
drops adapter-internal cached state for a query so the next send()
delivers fresh data. TopicQueryAdapter implements it as
unsubscribe(topic); stateless adapters like REST don't need to.
QueryInstance now calls adapter.invalidate?.(ctx) before each send() on
the refetch path, and markStale() kicks a debounced refetch when the
relay is currently active so invalidateQueries actually refreshes
mounted consumers without requiring a deactivate/reactivate cycle.
The TopicQueryAdapter.unsubscribe contract is strengthened to make the
"must call clearTopic" obligation explicit, since the base class can't
enforce it and any subclass that doesn't clear state will return stale
data on resubscribe.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fix `TopicQuery` refetch and `invalidateQueries` returning stale data on still-mounted consumers. Adds an optional `QueryAdapter.invalidate(ctx)` lifecycle method (`TopicQueryAdapter` implements it as `unsubscribe(topic)`; stateless adapters like REST don't need it). `QueryInstance` now calls `adapter.invalidate?.(ctx)` before each `send()` on the refetch path, and `markStale()` kicks a debounced refetch when the relay is currently active so `invalidateQueries` actually refreshes mounted consumers without requiring a deactivate/reactivate cycle.
0 commit comments