Urgent.News

What's breaking now, across thousands of outlets.

Tech

Our React App Worked Perfectly—Until Someone Closed Their Laptop

What sleep/wake bugs taught us about Supabase, network recovery, and building reliable SaaS applications. Imagine spending weeks building a React application. Authentication works. Database queries work. Real-time updates work. Your dashboard loads quickly, and your end-to-end tests are passing. You deploy it. Everything looks great. Then someone closes their laptop. They return an hour later,…

The seemingly flawless operation of a React application did not persist when users closed their laptops. After returning, users encountered issues such as pending requests, spinning loading indicators, and missing information. This became a significant reliability challenge in building Axon OSINT, a SaaS platform for digital investigations.

One of the most frustrating aspects of sleep/wake failures is that the application often does not crash. Instead, it displays subtle problems like information from an earlier session, pending requests, and actions that seem to be running but yield no results. During the development of Axon OSINT, these issues were observed in various areas, including investigation workspaces, account settings, and billing workflows.

React component state can survive longer than network state. JavaScript timers may be delayed, network connections may be interrupted, authentication credentials may expire, and real-time connections may disconnect. As a result, an asynchronous operation that began earlier may not complete when expected. React components, however, continue to exist in memory even after the user returns. This creates a dangerous situation where the UI may still appear functional, while the network may not be.

To address this issue, the developers improved the loadData function by adding error handling and ensuring the loading indicator is set to false after a reasonable amount of time. However, even with these improvements, the problem persisted. The developers then realized that they needed to treat the Supabase SDK as only one transport method, not the only one.

A timeout is useful for preventing the UI from waiting indefinitely, but it does not solve the underlying problem. A timeout alone does not cancel the underlying network request. To solve this, the developers implemented a strategy where critical operations use the SDK with a bounded timeout and an alternative direct HTTP route when necessary. This approach allows the application to prioritize performance and reliability.

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

Internal Links for Small WordPress Sites: Hubs, Orphans, and Links That Actually Help

Sitemaps tell Google a URL exists. Internal links tell Google (and humans) that you still stand behind it. On small WordPress sites — under a few hundred URLs — that endorsement gap is where…

  • Smaller WordPress sites struggle with indexation due to insufficient internal links.
  • Hub pages link to related pages with 5-15 contextual links for better SEO.

How to structure Stripe, Mercado Pago, and Asaas in one Laravel codebase

If you're building a SaaS for the Latin American market, you will inevitably face a hard architectural decision: how do you support multiple payment providers without turning your codebase into a mess…

  • Use Driver/Adapter pattern with typed interface to separate provider-specific code
  • Return structured arrays, store money as integers in cents to avoid coupling and issues
  • Handle webhooks asynchronously with eventId() for deduplication and retries

How to Build an MT5 Trading Bot Without Writing MQL Code

For years, automating a trading strategy on MetaTrader meant one thing: writing MQL. MQL4 and MQL5 are C-like languages built specifically for MetaTrader 4 and 5, and while they are capable, they come…

  • New tools translate plain-language strategy rules into working Expert Advisors without coding.
  • Conversion process is faster, but thorough testing in backtesting and forward testing is essential.
  • Approach makes algorithmic trading accessible to more traders and allows quick prototyping.

Wenn KI-Schlachten toben, hilft VR beim Sehen lernen

Wenn KI-Schlachten toben, hilft VR beim Sehen lernen Während die Tech‑Giganten um KI‑Geheimnisse und Talente ringen – OpenAI wirft einem Ex‑Mitarbeiter vor, 100+ Dateien an Apple weitergegeben zu…

  • AmblyoPunch VR app aids amblyopia treatment by training both eyes together.
  • Developed by Seven Sportz for Meta Quest, using dichoptic training in 3D environment.
  • App runs at 90 Hz per eye with latency under 20 ms for synchronized stimuli.

More from Monday 26 October →