mirror of
https://github.com/spartanz51/tutabridge.git
synced 2026-06-24 10:54:32 +02:00
Pull the event-routing decision out of event_handler::apply_batch into a pure bucket_updates(&[EntityUpdateEvent]) -> Bucketed function so it can be tested without standing up a MailStore or hitting the network. Six new tests cover empty batches, foreign apps, unknown type ids, the MailSetEntry-list de-duplication, mail-event ordering and a mixed batch. Add four MailStore tests for the new helpers: refresh_mail_in_place must update the metadata in every folder that holds the mail (Tuta's model allows multi-folder placement) while preserving the per-folder UID, and must no-op on an unknown id; remove_mail_everywhere drops from all folders and no-ops on an unknown id. Drop the dead `let _ = bus_event_groups;` in bridge.rs and document why event_groups() is not passed to the bus: the WebSocket subscribes implicitly via the auth, and the URL's `groupsToLastEventBatchIds=` is purely a per-group catch-up cursor. 148/148 lib tests pass.