System Design · Middle · Question 40 of 75
The unread message counter differs between tabs. How do you fix it?
- ✓Correct answer: Sync tabs via
BroadcastChannel - 2Forbid opening the site in multiple tabs
- 3Reload all tabs once a minute
Explanation
Each tab is a separate app with its own state. BroadcastChannel passes changes between them; you can also keep a single server connection in a SharedWorker and broadcast events to tabs.