refactor(events): consume dunite-events, drop bunyip bus + SSE copies #497

Merged
nrupard merged 1 commit from feat/DEV-528-consume-events into main 2026-08-06 19:03:43 +02:00
Owner

What

Consumes the dunite-events leaf crate (dunite #40, DEV-528) and removes bunyip's copies.

  • services/event_bus.rs keeps the concrete BunyipEvent enum (the SPA wire shape) and now implements dunite_events::SseEvent for it (name + target_user). EventBus becomes a type alias for dunite_events::EventBus<BunyipEvent>, so every services::EventBus path (main.rs, the admin/user handlers, ~10 sites) is unchanged. The local EventBus struct/impl and the bus unit tests are removed (parity tests live in the crate).
  • handlers/events.rs collapses to a thin handler: authenticate, then dunite_events::sse::sse_response(&bus, user.0.sub). The local SSE framing (encode_event, the merged stream, keepalive, resync) is gone.

Pins

Adds dunite-events at 1f536a2 as a leaf dep to bunyip-domain (the bus alias + SseEvent impl) and bunyip-api (the SSE adapter). No dunite-core dep, so it pins independently.

Validation

just check-container green: cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace --all-targets.

#DEV-528

## What Consumes the `dunite-events` leaf crate (dunite #40, DEV-528) and removes bunyip's copies. - `services/event_bus.rs` keeps the concrete `BunyipEvent` enum (the SPA wire shape) and now implements `dunite_events::SseEvent` for it (`name` + `target_user`). `EventBus` becomes a type alias for `dunite_events::EventBus<BunyipEvent>`, so every `services::EventBus` path (main.rs, the admin/user handlers, ~10 sites) is unchanged. The local `EventBus` struct/impl and the bus unit tests are removed (parity tests live in the crate). - `handlers/events.rs` collapses to a thin handler: authenticate, then `dunite_events::sse::sse_response(&bus, user.0.sub)`. The local SSE framing (`encode_event`, the merged stream, keepalive, resync) is gone. ## Pins Adds `dunite-events` at `1f536a2` as a leaf dep to bunyip-domain (the bus alias + `SseEvent` impl) and bunyip-api (the SSE adapter). No dunite-core dep, so it pins independently. ## Validation `just check-container` green: `cargo fmt --all --check`, `cargo clippy --workspace --all-targets -- -D warnings`, `cargo test --workspace --all-targets`. #DEV-528
refactor(events): consume dunite-events, drop bunyip bus + SSE copies
All checks were successful
E2E / PR gate (pull_request) Successful in 39s
Check / fmt + clippy + build + tests (pull_request) Successful in 25m56s
Create release / Create release from merged PR (pull_request) Has been skipped
57df47ccf3
The in-process event bus and the SSE framing moved to the dunite-events leaf crate (dunite #40, DEV-528).

services/event_bus.rs keeps the concrete BunyipEvent enum (the SPA wire shape) and now implements dunite_events::SseEvent for it; EventBus is a type alias for dunite_events::EventBus<BunyipEvent>, so every services::EventBus path (main.rs, the admin/user handlers) is unchanged. handlers/events.rs collapses to a thin handler that authenticates and calls dunite_events::sse::sse_response. The local EventBus struct/impl, the SSE framing, and the bus unit tests are removed (parity in the crate).

Adds dunite-events at 1f536a2 as a leaf dep to bunyip-domain (bus alias + SseEvent impl) and bunyip-api (the SSE adapter); no dunite-core dep, pinned independently.

#DEV-528
nrupard deleted branch feat/DEV-528-consume-events 2026-08-06 19:03:43 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/bunyip!497
No description provided.