Skip to content

Timeout WalletConnect disconnect and clear stale session - #241

Merged
Jaydbrown merged 1 commit into
conduit-protocol:mainfrom
silentgeckoaudit3801:fix/walletconnect-disconnect-timeout-190
Jul 29, 2026
Merged

Timeout WalletConnect disconnect and clear stale session#241
Jaydbrown merged 1 commit into
conduit-protocol:mainfrom
silentgeckoaudit3801:fix/walletconnect-disconnect-timeout-190

Conversation

@silentgeckoaudit3801

Copy link
Copy Markdown
Contributor

Summary

  • wrap WalletConnect remote disconnect calls with the existing timeout helper
  • clear the local session in a finally block so rejected/stalled disconnects do not leave stale local state
  • add regression tests for rejected and timed-out disconnects

Fixes #190.

Validation

  • git diff --check
  • marker checks for the timeout label and new disconnect regression tests

I did not run the Vitest suite locally because dependencies are not installed in this workspace and I avoided installing project packages.

Wrap remote disconnect calls in the existing timeout helper and clear local session state in a finally block so stale sessions are not retained when the wallet rejects or stalls. Add regression coverage for rejected and timed-out disconnects.

Fixes conduit-protocol#190.
@Jaydbrown
Jaydbrown merged commit 0da31a3 into conduit-protocol:main Jul 29, 2026
1 of 3 checks passed
Jaydbrown added a commit that referenced this pull request Jul 29, 2026
- governor.ts: parseGovernorConfig assigned 'undefined' directly to
  optional GovernorConfig fields, which exactOptionalPropertyTypes (true
  in tsconfig) rejects — a key must be entirely absent, not present with
  value undefined. Switched to conditional spreads. Regression from #231.

- builder-validation-bypass.test.ts: the fixture-address fix from #175
  never actually landed — I'd edited this file locally but forgot to
  stage it before that PR's final commit, so the squash-merge only
  included the earlier (broken-placeholder-address) revision. Reapplying
  the same fix now: replace the invalid 55-character StrKey strings with
  genuinely valid, checksummed addresses.

- walletconnect.test.ts: 'times out a stalled remote disconnect' (#241)
  left its returned promise unobserved for one microtask tick under fake
  timers, producing a 'handled asynchronously' unhandled-rejection
  warning that vitest sometimes misattributes to an unrelated test in the
  same run. Attach a no-op .catch() immediately to keep it always-handled;
  behavior/assertions are unchanged.
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.

Bug: WalletConnectAdapter.disconnect() has no timeout and can leave stale local session state

2 participants