Bound start-day reminder fan-out with lease-safe delivery #1168

Closed
opened 2026-08-20 06:32:14 +00:00 by timmy · 0 comments
Owner

Problem

Start-day Web Push reminders are dispatched serially. A slow endpoint blocks healthy devices and enough per-device timeouts can exceed the channel lease, allowing another worker to reclaim the channel while the stale worker continues sending. The existing STACKCHAIN_PUSH_MAX_CONCURRENCY setting is not forwarded to this channel.

Product impact

Morning reminders should reach healthy phones promptly and at most once even when another subscription is slow or a worker loses its lease.

Acceptance criteria

  • Dispatch due devices concurrently with the configured bounded concurrency.
  • Renew and verify the start-day lease immediately before each admitted send; a stale owner cannot send or checkpoint.
  • A blocked or unexpectedly failing device does not cancel healthy siblings.
  • Preserve permanent-subscription cleanup, transient retry, private payload, and per-plan-date checkpoint behavior.
  • Pass focused behavioral tests and the full suite.

Evidence

src/push_notifications.py currently awaits each device in a for loop; src/main.py passes max concurrency to unread/deadline channels but not start-day. Historical issue-title and recent-commit scans found no start-day lease/concurrency duplicate; #557/#551/#655 cover the older unread channel only.

## Problem Start-day Web Push reminders are dispatched serially. A slow endpoint blocks healthy devices and enough per-device timeouts can exceed the channel lease, allowing another worker to reclaim the channel while the stale worker continues sending. The existing `STACKCHAIN_PUSH_MAX_CONCURRENCY` setting is not forwarded to this channel. ## Product impact Morning reminders should reach healthy phones promptly and at most once even when another subscription is slow or a worker loses its lease. ## Acceptance criteria - Dispatch due devices concurrently with the configured bounded concurrency. - Renew and verify the start-day lease immediately before each admitted send; a stale owner cannot send or checkpoint. - A blocked or unexpectedly failing device does not cancel healthy siblings. - Preserve permanent-subscription cleanup, transient retry, private payload, and per-plan-date checkpoint behavior. - Pass focused behavioral tests and the full suite. ## Evidence `src/push_notifications.py` currently awaits each device in a `for` loop; `src/main.py` passes max concurrency to unread/deadline channels but not start-day. Historical issue-title and recent-commit scans found no start-day lease/concurrency duplicate; #557/#551/#655 cover the older unread channel only.
timmy self-assigned this 2026-08-20 06:32:14 +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#1168
No description provided.