Skip to content

LDEV-6277: expose wsClient.getSession()#20

Merged
zspitzer merged 1 commit intomasterfrom
LDEV-6277-getSession
Apr 20, 2026
Merged

LDEV-6277: expose wsClient.getSession()#20
zspitzer merged 1 commit intomasterfrom
LDEV-6277-getSession

Conversation

@zspitzer
Copy link
Copy Markdown
Member

Summary

Exposes the underlying JSR-356 Session on WSClient so listeners can reach getId(), getUserProperties(), and getRequestParameterMap(). The Session is already held by WSClient — this adds the dispatch key + branches.

Ticket: LDEV-6277

Why this matters

WebSocket callbacks run in a synthetic PageContext with no CFML session / cookie scope, so the JSR-356 Session is the only per-connection state a listener has. Every per-user pattern — handshake auth via query-string token, multi-tab tracking, tagging a connection with a userId — depends on reaching it. Before this PR, calling wsClient.getSession() threw WSClient does not have the function [getSession].

What changed

  • AbsWSClient.java — register the getSession key
  • WSClient.java — add dispatch branch in call() and callWithNamedValues(), expose in keys[] and toString()
  • CHANGELOG.md + README.md — document the new accessor
  • .github/workflows/main.yml — re-enable test-session-access in the integration loop (parked in tests: cover documented recipe claims that had no test #19 pending this fix)

Test plan

  • test-session-access flips from red to green (exercises getId() / getUserProperties() roundtrip / getRequestParameterMap() / per-connection isolation)
  • All 11 integration tests pass on Lucee 6.2 (javax) and 7.0 (jakarta)
  • Existing dispatch paths (send, broadcast, isOpen, isClose, close) unchanged — additive only

Listeners can now reach the underlying javax/jakarta websocket Session
via wsClient.getSession() for getId(), getUserProperties(), and
getRequestParameterMap(). The Session is already held by WSClient; this
adds the dispatch key + branch.

Also re-enables test-session-access (previously parked in CI pending
this fix).
@zspitzer zspitzer merged commit 280edb4 into master Apr 20, 2026
14 checks passed
@zspitzer zspitzer deleted the LDEV-6277-getSession branch April 20, 2026 13:19
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