Chapter 4 — Advanced
Edge cases, resilience, and power features
Multi-tab sync, reconnection recovery, rapid-fire mutations, scope isolation — the patterns that make query-tags production-ready. These are the demos you show before deploying to prod.
The Demos
Multi-Tab Sync
AdvancedSSE broadcasts everywhere
Open two browser tabs and watch them stay in sync. SSE naturally delivers invalidation events to every connected client.
SSEbroadcastReconnection
AdvancedGraceful recovery
Simulate a network failure and watch the system reconnect and re-sync missed invalidations without data loss.
reconnectresilienceRapid-Fire
Advanced10 mutations, zero races
Fire 10 mutations back-to-back and observe that the final state is always correct with no race conditions.
deduplicationbatchingScope Isolation
AdvancedMulti-tenant safety
Each tenant gets its own scope. Tenant A's mutations cannot invalidate Tenant B's queries. Full isolation by design.
appTags.scope(tenantId)isolationCascading Tags
AdvancedVisualize the hierarchy
An interactive tree visualizing how parent tag invalidation cascades down to every child query in the hierarchy.
tag hierarchycascadeOptimistic Updates
AdvancedInstant + correct
Optimistic UI with tag-based server validation. The UI updates instantly, and the server confirms or rolls back.
useOptimisticrollbackPath Registry
AdvancedDynamic tag registration
Register tags at runtime based on route paths. Useful for dynamic resources that aren't known at compile time.
pathRegistrydynamic tagsAuth Middleware
AdvancedProtect the SSE endpoint
The SSE endpoint is transport-agnostic. Add session, token, or scope-based auth at the route level — no library lock-in.
authmiddleware