Urgent.News

What's breaking now, across thousands of outlets.

Tech

Flutter Web in Two Tabs: Both Polling, Both Wrong

Your app works. Then a user opens it in a second tab, and things start going wrong in ways that never show up in testing. Both tabs poll the server, so your request volume doubles for one user. Both hold a WebSocket, so your connection count is wrong and your server thinks you have twice the traffic you do. Both raise the same desktop notification, so it appears twice. The user signs out in one…

Two tabs open an app simultaneously, and problems arise in ways that weren't discovered during testing. Each tab polls the server, causing the request volume to double. Both tabs maintain WebSocket connections, causing the server to think it's handling twice the traffic. The same desktop notification is raised twice, and if a user signs out in one tab, the other tab continues without any issue, still displaying data and refreshing it.

Users frequently open second tabs, and most web apps fail to handle this scenario. The platform provides a BroadcastChannel for messaging between same-origin browsing contexts, but it falls short in several aspects. There's no built-in way to know how many tabs are open, and there's no inherent mechanism to ensure only one tab performs the workload.

Developers must implement a solution for these issues, which involves leader election and handling tab closures appropriately.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

F1-U flow control: how a 5G base station's two halves stay in step

In 5G, the gNB is not a single box. Under the 3GPP higher-layer split (TS 38.401), a Central Unit owns the upper radio-protocol layers, and one or more Distributed Units own the real-time lower ones — RLC, MAC, and PHY.

  • 5G gNB consists of Central Unit (CU) and Distributed Units (DU)
  • F1-U connects CU and DU, carries GTP-U tunnels for NR User Plane Protocol (NR-U / NRUP)
  • Desired Buffer Size used for flow control, effectively bottomless for low-rate voice bearers

More from Thursday 3 September →