Skip to content

fix(analytics): pump a stale collector latch from wall-clock enqueue - #6950

Open
yzxcj797 wants to merge 3 commits into
koala73:mainfrom
yzxcj797:fix/6947-native-collector-latch
Open

fix(analytics): pump a stale collector latch from wall-clock enqueue#6950
yzxcj797 wants to merge 3 commits into
koala73:mainfrom
yzxcj797:fix/6947-native-collector-latch

Conversation

@yzxcj797

@yzxcj797 yzxcj797 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • queue-overflow on WORLDMONITOR-YD survived the harden(analytics): the collector deadline is request-side, so a fetch wrapper that ignores abort still parks the serialized queue #6288 latch because Chromium intensive throttling can withhold a 25s setTimeout (and AbortSignal.timeout, which uses the same scheduler) across an entire 60s health window. The queue is already full when the window opens and never drains, so the overflow write reports writeCount well below 50.
  • The overflow enqueue is itself a JavaScript turn, so Date.now() still advances. Enqueue now force-expires an in-flight write whose wall-clock age has already passed the 25s latch, then drains, before applying COLLECTOR_QUEUE_LIMIT.
  • Keep the module-owned setTimeout latch for visible pages where timers still fire. Do not move the latch onto AbortSignal.timeout — that is throttled the same way and cannot pump these windows.

Fixes #6947
Fixes WORLDMONITOR-YD

Type of change

  • Bug fix
  • New feature
  • New data source / feed
  • New map layer
  • Refactor / code cleanup
  • Documentation
  • CI / Build / Infrastructure

Affected areas

  • Map / Globe
  • News panels / RSS feeds
  • AI Insights / World Brief
  • Market Radar / Crypto
  • Desktop app (Tauri)
  • API endpoints (/api/*)
  • Config / Settings
  • Other: analytics collector transport

Checklist

  • Tested on worldmonitor.app variant
  • Tested on tech.worldmonitor.app variant (if applicable)
  • New RSS feed domains added to api/rss-proxy.js allowlist (if adding feeds)
  • No API keys or secrets committed
  • TypeScript compiles without errors (npm run typecheck)
  • New or repointed health probes have a completed Railway-side pre-seed, a one-way durable activation marker for an intentionally gated producer, or an owner-bound baseline acknowledgement with an entry-level expiresAt bounded to the first scheduled cron window (if applicable)

Documentation Alignment Checklist

Not applicable: this changes collector transport behavior only and does not publish or change documentation claims.

  • Claim ledger attached or linked
  • All required Audit Council role signoffs attached
  • Generated docs regenerated from proto where applicable
  • Fixture-backed examples recomputed
  • Redis writers/readers enumerated for every documented key

Screenshots

Not applicable.

@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

@yzxcj797 is attempting to deploy a commit to the World Monitor Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the trust:safe Brin: contributor trust score safe label Aug 19, 2026
AbortSignal.timeout uses the same throttled scheduler as setTimeout, so
moving the latch onto a retained native signal cannot pump a hidden-tab
queue. The overflow enqueue is itself a JS turn; Date.now still advances
there.

Force-expire an in-flight write whose wall-clock age has already passed
the 25s latch, then drain, before applying COLLECTOR_QUEUE_LIMIT. Keep
the module-owned setTimeout for visible pages where timers still fire.

Fixes koala73#6947
Fixes WORLDMONITOR-YD

Co-authored-by: Elie Habib <koala73@users.noreply.github.com>
@koala73 koala73 changed the title fix(analytics): keep the collector latch off throttled page timers fix(analytics): pump a stale collector latch from wall-clock enqueue Aug 19, 2026
…ck pump

The koala73#6947 pump test stayed green if .finally() skipped the epoch guard,
because later fetches still resolved 200. Park the successor, assert
calls === 2, and cover the compatibility, non-full, and all-critical
overflow paths the review called out.

Co-authored-by: Elie Habib <koala73@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trust:safe Brin: contributor trust score safe

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(analytics): queue-overflow survives the #6288 latch fix — 28 events from 18 post-fix builds, 100% below the queue bound

2 participants