fix(events): add unsubscribe() to EventBus protocol and implementations #11210

Closed
HAL9000 wants to merge 1 commits from pr-10356 into master

1 Commits

Author SHA1 Message Date
HAL9000 c1c2d1f059 fix(events): add unsubscribe() to EventBus protocol and implementations (#10356)
CI / lint (pull_request) Failing after 1m11s
CI / quality (pull_request) Successful in 1m28s
CI / typecheck (pull_request) Successful in 1m35s
CI / security (pull_request) Successful in 1m35s
CI / helm (pull_request) Successful in 44s
CI / push-validation (pull_request) Successful in 44s
CI / build (pull_request) Successful in 1m1s
CI / integration_tests (pull_request) Successful in 5m30s
CI / unit_tests (pull_request) Failing after 8m31s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 3s
Add individual handler unsubscription to the EventBus protocol and all
implementations (ReactiveEventBus, LoggingEventBus, TrackingEventBus).

Changes:
- EventBus protocol adds `unsubscribe(subscription_id) -> bool` and changes
  `subscribe()` return type from None to EventSubID (ULID string)
- EventSubID = str type alias for subscription IDs
- ReactiveEventBus stores subscriptions as (sub_id, handler) tuples per
  EventType, enabling individual unsubscription by ULID
- LoggingEventBus uses the same pattern for consistent protocol conformance
- TrackingEventBus mock updated with subscribe/unsubscribe support
- EventBusBridge.start() now receives a proper subscription ID return from
  subscribe(), resolving existing subscription handle tracking
- robot/helper_event_bus.py gain unsubscribe test commands

This resolves issue #10356 and makes all bus implementations satisfy the
full EventBus protocol with per-handler lifecycle management.
2026-05-16 08:27:56 +00:00