#1062·urql

RFC: Cross-Tab Synchronization Exchange

Author: kittenCreated Oct 14, 2020Updated Feb 13, 2025
Labelsfuture 🔮

Summary

Especially with Graphcache we've discussed cases where a sufficiently complex app may want to synchronize what's happening across apps. As part of this one may have multiple tabs of a Graphcache application opened.

We can make the assumption that it doesn't matter whether the cache itself is 100% in sync, but we hypothesize that two tabs of Graphcache can already coexist (Needs Testing)

A cross-tab synchronization exchange can therefore focus on distributing results across all apps.

Proposed Solution

Create an exchange that deduplicates fetching results and distributes results to other tabs, maybe using the BroadcastChannel API.

  • Multiple exchanges of cross-tabs sync should be aware of one another
  • Only one tab (the latest active one?) should execute an operation
  • The results from that tab should be distributed to other tabs
  • Check whether Graphcache's persistence conflicts when multiple tabs are open

Related Conversations