Skip to content

refactor(gateway): SSE fault stream reads a neutral event source - #757

Open
bburda wants to merge 1 commit into
mainfrom
feat/gateway-core-7-sse-fault-source
Open

bburda wants to merge 1 commit into
mainfrom
feat/gateway-core-7-sse-fault-source

Conversation

@bburda

@bburda bburda commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

The SSE fault handler reads fault events from FaultEventSource, a ROS-free interface built on the shared fault types from #736. The ROS side implements it with a subscription to the fault event topic. Fault JSON keeps 64-bit seconds.


Issue


Type

  • Bug fix
  • New feature or tests
  • Breaking change
  • Documentation only

Testing

  • ./scripts/test.sh test_sse_fault_handler
  • ./scripts/test.sh integ --packages-select ros2_medkit_integration_tests covers the fault stream end to end (test_sse_fault_stream, test_aggregator_fault_stream, test_scenario_fault_lifecycle).

Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Tests were added or updated if needed
  • Docs were updated if behavior or public API changed

The SSE fault handler consumes a ROS-free fault event source built on the
shared fault types. Fault JSON keeps 64-bit seconds.
@bburda
bburda added this pull request to stack #759 October 24, 2026 14:18
@bburda bburda self-assigned this Oct 24, 2026

/// Start delivering events to `callback`; replaces any earlier callback.
/// The callback may run on any thread.
virtual void subscribe(Callback callback) = 0;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subscribe() replaces the single callback and unsubscribe() clears it for everyone. A second SSEFaultHandler on the same services takes the stream from the first one, and when either is destroyed the other stops getting events. Before this PR each handler had its own subscription. The test fixture already hits this: GatewayNode's own handler, then handler_, then limited_handler/fast_handler. Have subscribe() return an owned handle that removes only its own callback, and add a test where two handlers both receive an event and one survives the other's destruction.

This branch has not been deployed

No deployments
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.

2 participants