Skip to content

Expose ActivateSession service result on UaSession#1730

Merged
kevinherron merged 2 commits intomainfrom
tasks/activate-session-service-result
Apr 19, 2026
Merged

Expose ActivateSession service result on UaSession#1730
kevinherron merged 2 commits intomainfrom
tasks/activate-session-service-result

Conversation

@kevinherron
Copy link
Copy Markdown
Contributor

Summary

Expose the most recent successful ActivateSession service result through UaSession so client code can observe advisory Good_* outcomes such as Good_PasswordChangeRequired after a session is established or reactivated.

  • Add UaSession.getLastActivateSessionServiceResult() and back it with OpcUaSession so callers can inspect the latest successful ActivateSession status without reaching into lower-level protocol objects.
  • Update the session FSM to record the ActivateSessionResponse service result on both initial activation and reactivation so the session reflects the server's latest accepted response.
  • Add integration coverage for the default success case and for advisory-good responses such as Good_PasswordChangeRequired, using a delegating test service set to customize ActivateSession responses.

Key Changes

  • Session API surface: UaSession now exposes an optional last ActivateSession service result, which keeps the API backward compatible for session implementations that do not populate it.
  • Session lifecycle tracking: SessionFsmFactory stores the service result after both initial activation and reactivation so the session reflects the latest successful server response.
  • Integration test harness: Add a delegating session service set for tests so ActivateSession responses can be overridden without replacing the default session service implementation.

Testing

  • ActivateSessionServiceResultTest verifies that a connected client session exposes a present, good ActivateSession service result after connect.
  • ActivateSessionServiceResultOverrideTest verifies that advisory good codes returned by ActivateSession, including Good_PasswordChangeRequired, are preserved on the client session.
  • Verification command: mvn -q clean verify

References

Store the most recent successful ActivateSession status on UaSession so
clients can inspect advisory Good_* responses like
Good_PasswordChangeRequired after activation succeeds.

Update the value during both initial activation and reactivation so the
session reflects the latest server response.
- Introduce `ActivateSessionServiceResultOverrideTest` to validate custom `ActivateSessionResponse` service results.
- Add `ActivateSessionServiceResultTest` to ensure the last service result is recorded correctly post-connect.
- Implement `DelegatingSessionServiceSet` to delegate and customize session service handling in tests.
@kevinherron kevinherron added this to the 1.1.3 milestone Apr 16, 2026
@kevinherron kevinherron merged commit 3e06fa4 into main Apr 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant