Skip to content

test(frontend): connectionStore concurrent connect race (closes #256) - #268

Merged
EVWorth merged 1 commit into
mainfrom
test/issue-256-connection-store-race
Jul 24, 2026
Merged

test(frontend): connectionStore concurrent connect race (closes #256)#268
EVWorth merged 1 commit into
mainfrom
test/issue-256-connection-store-race

Conversation

@EVWorth

@EVWorth EVWorth commented Jul 23, 2026

Copy link
Copy Markdown
Owner

5 new tests pin the concurrent-connect / disconnect-reconnect race behavior that was untested. The deferred() helper already existed in this file (line 53) for this purpose.

Concurrent connect (2):

  • Two parallel connect() calls each create their own entry; current implementation does not dedupe or gate by in-flight status. second selectedConnectionId wins.
  • One parallel connect errors while another succeeds — prior in-flight connection survives, error populates error state.

Connect + disconnect race (2):

  • Disconnect issued before connect resolves leaves the entry in activeConnections (no cancellation hook exists).
  • Disconnect issued after connect resolves removes the entry normally.

Reconnect (1):

  • Disconnect-then-reconnect with same profile produces no duplicate entry.

The tests document current behavior (not "ideal" behavior). Several are candidates for a future enhancement to add proper cancellation / in-flight dedup.

Closes #256

…loses #256)

5 new tests pin the concurrent-connect / disconnect-reconnect race
behavior that was untested. The `deferred()` helper already existed
in this file (line 53) for this purpose.

Concurrent connect (2):
- Two parallel connect() calls each create their own entry; current
  implementation does not dedupe or gate by in-flight status. second
  selectedConnectionId wins. Documenting this prevents accidental
  regressions.
- One parallel connect errors while another succeeds — prior in-flight
  connection survives, error populates error state.

Connect + disconnect race (2):
- Disconnect issued before connect resolves leaves the entry in
  activeConnections (no cancellation hook exists).
- Disconnect issued after connect resolves removes the entry normally.

Reconnect (1):
- Disconnect-then-reconnect with same profile produces no duplicate
  entry; only the new connection remains.

The tests document current behavior (not "ideal" behavior). Several
of these are candidates for a future enhancement to add proper
cancellation / in-flight dedup, but the scope of this PR is test-only.

Closes #256
@EVWorth
EVWorth merged commit 7b1d117 into main Jul 24, 2026
10 checks passed
@EVWorth
EVWorth deleted the test/issue-256-connection-store-race branch July 24, 2026 01:04
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.

test(frontend): connectionStore.connect() concurrent invocation tests

1 participant