Skip to content

fix(alerts): a flapping phone still buzzed every cycle — cap pushes per worker - #349

Merged
GeiserX merged 1 commit into
mainfrom
fix/offline-push-floor
Aug 19, 2026
Merged

fix(alerts): a flapping phone still buzzed every cycle — cap pushes per worker#349
GeiserX merged 1 commit into
mainfrom
fix/offline-push-floor

Conversation

@GeiserX

@GeiserX GeiserX commented Aug 19, 2026

Copy link
Copy Markdown
Owner

The sustained-recovery damping merged this morning (#348) was defeated within hours, by the same phone, in the opposite direction: its normal duty cycle turned out to be 7–10 minutes awake, 2–3 minutes dozing. Every wake window passed the ~4-minute sustained bar, re-armed the alert, and the next nap pushed again — eight Telegram messages in two hours with the damping active. A worker whose ordinary operation is rhythmic flapping can never be rate-limited by episode detection, whatever the threshold.

The cap now sits on the notification itself. After an offline push for a worker, further offline pushes for that worker wait out a 6-hour floor, independent of episodes. The first push for a genuinely dead server is still immediate. The dashboard and bell keep tracking every episode in real time — only the phone-buzz is capped (worst case 4/day/worker, down from ~100/day observed). Recovery deliberately never resets the floor, because resetting on recovery is exactly the re-arm loop this ends. A total delivery failure releases the floor, so the existing un-dedupe retry contract ("will retry on the next cycle") stays true.

Floor state is in-memory: a restart forgets it, which at worst costs one early push. TestOfflinePushFloor pins all four properties (suppressed-but-recorded inside the floor, expiry re-pushes, recovery never resets, failed delivery releases), mutation-verified — removing the gate turns the suite red.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@GeiserX, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 24 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0469af4b-7baa-4b87-a92f-e36a60b4f9f8

📥 Commits

Reviewing files that changed from the base of the PR and between cbae6f9 and 2b6aaad.

📒 Files selected for processing (3)
  • app/main.py
  • tests/conftest.py
  • tests/test_worker_offline_alerts.py
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch fix/offline-push-floor
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/offline-push-floor

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…a rhythmic phone

The sustained-recovery damping (v1.36.1) was defeated within hours by the
same phone: its NORMAL duty cycle turned out to be 7-10 minutes awake,
2-3 minutes dozing — every wake window passed the sustained bar, re-armed
the alert, and the next nap pushed again. Eight pushes in two hours,
live, with the damping active. A worker whose ordinary operation is
rhythmic flapping can never be rate-limited by episode detection.

So the cap moves to the notification itself: after an offline push for a
worker, further offline pushes for THAT worker wait out a 6-hour floor,
independent of episodes. The first push for a genuinely dead server is
still immediate; the dashboard and bell keep tracking every episode in
real time; only the phone-buzz is capped (worst case 4/day/worker, down
from ~100). Recovery deliberately never resets the floor — resetting on
recovery is exactly the re-arm loop this ends. A total delivery failure
releases the floor so the un-dedupe retry contract stays true.

Floor state is in-memory: a restart forgets it, costing at most one early
push. Pinned in TestOfflinePushFloor (records-but-does-not-push inside
the floor, expiry re-pushes, recovery never resets, failed delivery
releases); mutation-verified — removing the gate turns the suite red.
@GeiserX
GeiserX force-pushed the fix/offline-push-floor branch from d138d9d to 2b6aaad Compare August 19, 2026 15:33
@GeiserX

GeiserX commented Aug 19, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.58%. Comparing base (cbae6f9) to head (2b6aaad).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #349      +/-   ##
==========================================
+ Coverage   95.56%   95.58%   +0.01%     
==========================================
  Files          51       51              
  Lines        7259     7268       +9     
==========================================
+ Hits         6937     6947      +10     
+ Misses        322      321       -1     
Files with missing lines Coverage Δ
app/main.py 97.83% <100.00%> (+<0.01%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@GeiserX

GeiserX commented Aug 19, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@GeiserX

GeiserX commented Aug 19, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@GeiserX
GeiserX merged commit c4cf3cf into main Aug 19, 2026
8 checks passed
@GeiserX
GeiserX deleted the fix/offline-push-floor branch August 19, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant