Skip to content

Analytics: older requests can overwrite newer filters or a later page visit #2200

Closed

Description

@n30nex

Problem

The Analytics page has no generation check around its six-request bulk load. If a user changes the time window or region while an earlier request is pending, whichever batch finishes last replaces the page, even when it belongs to the older selection. A late rejection can similarly replace newer results with an error. Leaving and re-entering the page does not invalidate that earlier load.

A related readiness problem occurs when a tab click or theme-refresh renders Overview/RF/etc. before _analyticsData has been populated. Overview dereferences rf.totalTransmissions while rf is undefined. The early theme-refresh case is also noted in #2194; a guard at the common rendering boundary is needed for tab clicks as well.

Reproduction

  1. Open Analytics with a delayed response for one of the initial analytics requests.
  2. Select a different time window and let that newer batch finish first.
  3. Release the older response. The old data replaces the results under the newer selection.
  4. Alternatively, leave/re-enter Analytics before releasing the old response, or switch Overview/RF tabs while the first batch is pending.

Deterministic tests against the actual analytics page IIFE reproduce the out-of-order success, stale rejection, early rendering and page-leave cases without live network timing.

Expected

Only the current page visit and filter selection may update the page. Data-dependent tabs retain a clear loading/error state until their required responses arrive. Independently loaded tabs remain usable and are not rebuilt or replaced by an unrelated late bulk result.

This is a focused lifecycle correction, with no database or API changes. Related: #1778 and #1925.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions