Bound Web Push fan-out latency across devices #557

Closed
opened 2026-08-11 08:50:06 +00:00 by timmy · 0 comments
Owner

Problem

Unread Web Push delivery sends to every device serially. One endpoint may consume the full 10-second timeout before any healthy device behind it is attempted, so fleet latency grows as device count × timeout and the poll loop itself stalls.

User impact

Healthy phones should receive new-work notifications promptly even when another device endpoint is slow or unavailable.

Acceptance criteria

  • Dispatch different devices concurrently with a conservative configurable bound.
  • Preserve sequential thread order within each device.
  • A timeout or transient failure stops further attempts for that device in the current poll while retaining unseen updates for retry.
  • HTTP 404/410 removes the dead device subscription.
  • Session validation remains fail-closed and lease fencing prevents sends after ownership loss.
  • Focused behavioral tests prove bounded concurrency and slow-endpoint isolation; full suite passes.

Evidence / non-duplication

src/push_notifications.py currently has nested serial loops and STACKCHAIN_PUSH_SEND_TIMEOUT_SECONDS defaults to 10 seconds. #551 added cross-worker leasing, deadlines, and failure isolation, but did not add bounded intra-poll concurrency; the serial loops remain on current main. No open issue or PR covers bounded Web Push device fan-out.

## Problem Unread Web Push delivery sends to every device serially. One endpoint may consume the full 10-second timeout before any healthy device behind it is attempted, so fleet latency grows as device count × timeout and the poll loop itself stalls. ## User impact Healthy phones should receive new-work notifications promptly even when another device endpoint is slow or unavailable. ## Acceptance criteria - Dispatch different devices concurrently with a conservative configurable bound. - Preserve sequential thread order within each device. - A timeout or transient failure stops further attempts for that device in the current poll while retaining unseen updates for retry. - HTTP 404/410 removes the dead device subscription. - Session validation remains fail-closed and lease fencing prevents sends after ownership loss. - Focused behavioral tests prove bounded concurrency and slow-endpoint isolation; full suite passes. ## Evidence / non-duplication `src/push_notifications.py` currently has nested serial loops and `STACKCHAIN_PUSH_SEND_TIMEOUT_SECONDS` defaults to 10 seconds. #551 added cross-worker leasing, deadlines, and failure isolation, but did not add bounded intra-poll concurrency; the serial loops remain on current main. No open issue or PR covers bounded Web Push device fan-out.
timmy self-assigned this 2026-08-11 08:50:07 +00:00
timmy closed this issue 2026-08-11 08:56:58 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#557
No description provided.