Skip to content

DEV-203 Clear RFQ session cache on disconnect#89

Open
cesarenaldi wants to merge 2 commits into
feature/dev-200-define-rfq-websocket-behavior-for-uncorrelated-error-framesfrom
feature/dev-203-clear-cached-rfq-session-immediately-on-websocket-disconnect
Open

DEV-203 Clear RFQ session cache on disconnect#89
cesarenaldi wants to merge 2 commits into
feature/dev-200-define-rfq-websocket-behavior-for-uncorrelated-error-framesfrom
feature/dev-203-clear-cached-rfq-session-immediately-on-websocket-disconnect

Conversation

@cesarenaldi
Copy link
Copy Markdown
Collaborator

@cesarenaldi cesarenaldi commented Jun 4, 2026

Summary

  • Clear the RFQ manager's cached session synchronously from the unexpected websocket close handler.
  • Avoid returning a cached session once it is closing.
  • Add integration coverage for reopening immediately from the failed quote wait after an unexpected disconnect.

Verification

  • pnpm vitest --project client-integration packages/client/tests/integration/rfq.test.ts (completed; current test fixture skipped 24 tests)
  • pnpm typecheck
  • pnpm lint

Stacked on: #88
Linear: DEV-203


Note

Medium Risk
Changes RFQ websocket session lifecycle and reconnect behavior in a trading path; scope is small and covered by a new integration test.

Overview
Fixes RFQ quoter reconnect after an unexpected websocket close by not reusing a dead cached session.

RfqQuoterWebSocketManager.connect() now drops the cached session when it is closing/closed and opens a new one instead of returning the stale handle. RfqWebSocketSession exposes a closed flag for that check. On socket close, #handleClose invokes the manager’s onClose callback before async shutdown so the cache is cleared synchronously when the connection drops.

Adds an integration test that quotes, forces the server to close mid-flight, then openRfqSession() again and expects a new session and a second connection.

Reviewed by Cursor Bugbot for commit d682421. Bugbot is set up for automated code reviews on this repo. Configure here.

…related-error-frames' into feature/dev-203-clear-cached-rfq-session-immediately-on-websocket-disconnect
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