Skip to content

fix(server): scope disconnect cleanup to current connection#162

Merged
ZingerLittleBee merged 2 commits into
mainfrom
fix/agent-disconnect-cleanup
Jul 15, 2026
Merged

fix(server): scope disconnect cleanup to current connection#162
ZingerLittleBee merged 2 commits into
mainfrom
fix/agent-disconnect-cleanup

Conversation

@ZingerLittleBee

Copy link
Copy Markdown
Owner

Summary

  • move temporary grant cleanup into the shared current-connection removal path
  • prevent a superseded Agent WebSocket from clearing grants reported by the active replacement connection
  • add end-to-end regression coverage through the Agent WebSocket and REST server DTO

Why

The superseded socket cleanup previously cleared temporary grants unconditionally, even when connection fencing correctly rejected removal of the stale connection ID. This could erase runtime state that the replacement connection had just reported.

Testing

  • cargo test -p serverbee-server --lib service::agent_manager::tests::
  • cargo test -p serverbee-server --test ws_agent_dispatch2
  • cargo clippy -p serverbee-server --test ws_agent_dispatch2 --all-features
  • mutation check: restoring the old unconditional cleanup makes the new reconnect regression test fail

@ZingerLittleBee
ZingerLittleBee merged commit e2aa3b8 into main Jul 15, 2026
5 of 6 checks passed
@ZingerLittleBee
ZingerLittleBee deleted the fix/agent-disconnect-cleanup branch July 15, 2026 17:25
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