Repository navigation
fix(webpush): cap in-flight sends per subscription - #287
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 12:57 AM ET / 04:57 UTC (Revision 7). ClawSweeper reviewWhat this changesThe PR serializes browser push delivery per endpoint, bounds all pending alerts together, and adds transport regression tests, documentation, and a changelog entry. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main and v0.7.0 allow one slow endpoint to occupy all four workers. The prior findings are resolved, production transport proof remains sufficient, and no actionable defect was found. Priority: P2 Review scores
Verification
How this fits togetherClickClack queues browser notifications after chat messages are posted. Delivery workers recheck device registration and recipient access, then encrypt and send alerts through the browser’s push service. flowchart TD
A[Chat notification] --> B[Shared pending budget]
B --> C{Endpoint already sending}
C -->|Yes| D[Endpoint waiting list]
C -->|No| E[Delivery worker]
D --> E
E --> F[Recheck device and recipient]
F --> G[Encrypted push request]
G --> H[Record delivery outcome]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep endpoint serialization within the existing worker pool and shared pending budget while preserving send-time authorization and normal delivery bookkeeping. Do we have a high-confidence way to reproduce the issue? Yes: current-main source shows that four alerts for one held endpoint can occupy all four workers, and the captured body reports the isolation regression failing on main. This read-only review did not execute it. Is this the best way to solve the issue? Yes: endpoint ownership and aggregate pending accounting address worker monopolization without changing configuration, stored subscriptions, or authorization. AGENTS.md: found, but no applicable review policy affected this item. Codex review notes: model internal, reasoning medium; reviewed against 8ca28becb38c. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
Serialize each endpoint within the shared worker pool and pending budget. Keep accepted alerts, per-send authority checks, and normal success bookkeeping intact. Co-authored-by: Sebastien Tardif <sebtardif@ncf.ca>
4d28bd4 to
cd3ced5
Compare
|
Merged as 94e3b71. Thanks @SebTardif. The main-branch regression reproduced All checks passed on cd3ced5: server/web/Docker/browser CI and Windows/macOS/Linux desktop CI. The real transport proof uses a synthetic local relay, not a public push provider. Existing best-effort overflow/restart behavior and delivery authorization remain intact. |
One slow browser push endpoint could occupy all four delivery workers, delaying notifications to other devices. Serialize sends per endpoint within the existing pool. Later alerts for that endpoint wait, and the shared channel plus waiting lists share the existing 1,024-alert pending budget. Every send still rechecks device/session/message authority and uses unchanged success and backoff bookkeeping.
The finished change removes an unreachable dropped-result branch, clears consumed waiting entries, preserves all accepted alerts after sender panics, and adds cleanup and generous timeout headroom to the real HTTP tests. Updated the push delivery guide and Unreleased changelog. Thanks @SebTardif.
Validation: the new isolation regression failed on main with
subscription had 4 deliveries in flight, want 1. On the candidate, isolation, encrypted HTTP/SQLite delivery, shared overflow, panic recovery, and delayed-success cases passed three times undergo test -race. Fullpnpm checkpassed on AWS Crabbox (Go 1.27.1, Node.js 24, pnpm 12.7.0). Independent Codex review is scoped-clean through P2 after fixing the initial review's test timeout finding. GitHub CI must pass on the updated head before merge.The transport tests use a synthetic local relay, not a public push provider. The existing best-effort overflow and restart behavior is unchanged.