[client] Coalesce SubscribeStatus snapshot bursts - #6942
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesStatus stream coalescing
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@client/server/status_stream.go`:
- Around line 75-76: Update the timer.C branch in the status-stream coalescing
loop to non-blockingly drain any already-buffered tick from ch before returning
pending, true. Preserve the existing behavior when no tick is queued and ensure
the drain does not wait for a future tick.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 90bf28dc-d4d3-43e3-bf81-08eee92cd198
📒 Files selected for processing (1)
client/server/status_stream.go
|
Release artifactsBuilt for PR head
GHCR images (amd64)
This comment is updated by the Release workflow. Artifact links expire according to the workflow retention policy. |



Describe your changes
SubscribeStatus sent a full status snapshot for every state change tick, so bursts (route reevaluation, peer connect and teardown, engine start and stop) produced many redundant sends of identical or nearly identical snapshots, each one serialized and rendered again by the desktop UI.
This change coalesces bursts deterministically: the first tick is sent immediately, then a 200ms window absorbs the rest and a single trailing snapshot covers whatever arrived meanwhile. Every send remains a full snapshot of the current
state, so no information is lost. In local testing a connect cycle dropped from about 15 sends to 6.
Issue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit