refactor(core): remove dead EventBus ReloadFilters/unread_count arms #344

Merged
KofTwentyTwo merged 1 commits from story/ws-f4-eventbus-cleanup into dev 2026-07-31 20:38:59 +00:00
KofTwentyTwo commented 2026-07-31 20:37:36 +00:00 (Migrated from github.com)

Summary

  • Removes CoreCommand::ReloadFilters -- confirmed via workspace-wide git grep that nothing sends it; filter reload actually happens via FiltersGrpcService::reload_engine_from_store in nunciod/src/grpc.rs, a completely separate path. The match arm was a silent no-op (CoreCommand::ReloadFilters => {}).
  • Removes AppState::unread_count and the increment/decrement logic in the MarkRead command handler -- confirmed via git grep that no consumer in nunciod/nuncio-cli/nuncio-proto ever reads AppState.unread_count; only state.status is read (for GetStatusResponse, which carries just engine_status + version per proto/nuncio/v1/nuncio.proto). The field never reached the wire.
  • No proto/wire changes. nuncio-proto and the golden descriptor are untouched.
  • Updated the two affected nuncio-core unit tests (with_initial_state_seeds_snapshot, and the renamed process_mark_read_emits_flags_changed_for_each_call) to drop unread_count assertions while still covering MarkRead -> MessageFlagsChanged event behavior.
  • Checked crates/nunciod/src/main.rs's match cmd { ... } over CoreCommand -- it has a wildcard _ => {} arm, so removing ReloadFilters doesn't affect exhaustiveness there.

Refs #324

Test plan

  • cargo fmt --all -- --check
  • cargo check-all (clippy --all-targets --workspace -D warnings)
  • cargo test-all -- 0 failed, 0 ignored, workspace-wide
## Summary - Removes `CoreCommand::ReloadFilters` -- confirmed via workspace-wide `git grep` that nothing sends it; filter reload actually happens via `FiltersGrpcService::reload_engine_from_store` in `nunciod/src/grpc.rs`, a completely separate path. The match arm was a silent no-op (`CoreCommand::ReloadFilters => {}`). - Removes `AppState::unread_count` and the increment/decrement logic in the `MarkRead` command handler -- confirmed via `git grep` that no consumer in `nunciod`/`nuncio-cli`/`nuncio-proto` ever reads `AppState.unread_count`; only `state.status` is read (for `GetStatusResponse`, which carries just `engine_status` + `version` per `proto/nuncio/v1/nuncio.proto`). The field never reached the wire. - No proto/wire changes. `nuncio-proto` and the golden descriptor are untouched. - Updated the two affected `nuncio-core` unit tests (`with_initial_state_seeds_snapshot`, and the renamed `process_mark_read_emits_flags_changed_for_each_call`) to drop `unread_count` assertions while still covering `MarkRead` -> `MessageFlagsChanged` event behavior. - Checked `crates/nunciod/src/main.rs`'s `match cmd { ... }` over `CoreCommand` -- it has a wildcard `_ => {}` arm, so removing `ReloadFilters` doesn't affect exhaustiveness there. Refs #324 ## Test plan - [x] `cargo fmt --all -- --check` - [x] `cargo check-all` (clippy --all-targets --workspace -D warnings) - [x] `cargo test-all` -- 0 failed, 0 ignored, workspace-wide
Sign in to join this conversation.