Skip to content

Close every owned client session when the connection ends - #12

Open
OskarEichler wants to merge 1 commit into
faye:mainfrom
OskarEichler:codex/close-unselected-client-sessions
Open

Close every owned client session when the connection ends#12
OskarEichler wants to merge 1 commit into
faye:mainfrom
OskarEichler:codex/close-unselected-client-sessions

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Retain ownership of every client session generated for the handshake, including ones not selected by the server, and close each once when the connection ends. Clear ownership before callbacks to make repeated close harmless.

Reproduction and verification

# Offer two registered extensions, 'a' and 'b':
exts.generate_offer
exts.activate('a')
exts.close # closes both constructed client sessions
exts.close # does not close them again

Six focused lifecycle checks cover selection, activation failure, unknown response, repeated close and callback failure. Cleanup stays at the documented connection-close boundary; no new early close callback is introduced.

  • Ruby 4.0.6 through rbenv; existing current-upstream suite: 64 examples, zero failures on this isolated change.
  • The cumulative release-based candidate passes 283 focused checks (272 baseline failures → zero), 2,784 model checks, the current upstream's 64-example suite, and gem build/extraction.
  • The historical 0.1.5 suite has three Ruby keyword-versus-options-hash mock failures on both baseline and candidate. Current upstream already corrected those expectations; they were run against the candidate through an external preload without changing repository tests.
  • No new or modified tests/specs, following the consumer repository's explicit policy. Reproductions/models were run from external scratch scripts.

Breaking changes and limitations

Intentional lifecycle correction: unselected sessions now receive their required close callback, and repeated close does not repeat callbacks. Callbacks raising StandardError remain isolated as before.

Only local Ruby 4.0.6/macOS execution is claimed; the repository's older Ruby/JRuby matrix needs upstream CI. No production access or unrelated release upgrades.

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