Skip to content

feat(container): SESSION bean scope — one instance per HttpSession (v26.06.46)#73

Merged
ancongui merged 1 commit into
mainfrom
feat/session-custom-scope
Jun 7, 2026
Merged

feat(container): SESSION bean scope — one instance per HttpSession (v26.06.46)#73
ancongui merged 1 commit into
mainfrom
feat/session-custom-scope

Conversation

@ancongui
Copy link
Copy Markdown
Contributor

@ancongui ancongui commented Jun 7, 2026

Scope.SESSIONregister(scope=Scope.SESSION) yields one bean instance per HTTP session (Spring's session scope). The instance lives as an HttpSession attribute (so the SessionFilter must be active; persisted with the session → must be serializable for non-memory stores like Redis). The SessionFilter now exposes the active HttpSession to the container via RequestContext, mirroring REQUEST-scope resolution; clear errors when no request context / session is present. Tests (4): same-instance-within-session, distinct-across-sessions, requires-session, requires-request-context. A general custom-scope SPI stays on the roadmap. Gates: mypy --strict (620), ruff+format, full suite 3841.

…bump v26.06.46

- Scope.SESSION: register(scope=Scope.SESSION) -> one instance per HttpSession (Spring session
  scope). Instance stored as a session attribute (persisted with the session; must be
  serializable for non-memory stores like Redis). Errors clearly without a RequestContext/session.
- SessionFilter exposes the active HttpSession to the container via RequestContext
  (HTTP_SESSION_KEY), mirroring REQUEST-scope resolution.

Tests: tests/container/test_session_scope.py (4). Gates: mypy --strict (620), ruff + format,
full suite 3841 passed.
@ancongui ancongui merged commit fb34d27 into main Jun 7, 2026
5 checks passed
@ancongui ancongui deleted the feat/session-custom-scope branch June 7, 2026 12:21
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