Skip to content

[Due for payment 2026-06-19] [$250] Concierge streaming reply only advances while the browser tab is focused #92866

Description

@melvin-bot

Platform

Web (any Chromium/Firefox tab-throttling browser)

Problem

When Concierge streams a reply and you switch to another browser tab, the visible text stops advancing. When you return to the tab, it resumes streaming from where it left off — even though the full response was delivered long ago. Streaming should keep up (or complete) regardless of whether the tab is focused.

Root Cause

The Concierge draft pacer reveals the reply one markdown unit per setInterval tick (PUSHER_DRAFT_PACE_INTERVAL_MS = 10ms), and the reveal amount is driven by tick count, not wall-clock time. Browsers throttle/freeze setInterval in backgrounded tabs (Chrome clamps to ≥1000ms after ~1s hidden, effectively freezing timers after ~5 min), so the reveal stalls while hidden and drains rapidly on refocus. The full server text is already buffered over Pusher; only the reveal is gated on the throttled timer.

Key files:

Contrast with the working path: src/hooks/usePendingConciergeResponse.ts computes progress from Date.now() - trickleStart, so a single throttled tick recomputes the correct wall-clock stage and self-corrects on tab return. The Pusher pacer lacks this anchor.

Suggested Fix

  1. Anchor the reveal to wall-clock elapsed time — reveal up to rate × elapsed characters so one post-refocus tick catches up instantly. The optimistic trickle in src/hooks/usePendingConciergeResponse.ts already does this and can serve as a reference.
  2. Use @libs/Visibility — listen for visibilitychange: when the tab becomes hidden (or on becoming visible with a completed response already buffered), reveal the full buffered target immediately instead of pacing through it tick by tick.
Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions