mirror of
https://github.com/spartanz51/tutabridge.git
synced 2026-06-24 10:54:32 +02:00
4ae4257b5c22621fa925bddf61fa972ab6938506
The CLI (`src/main.rs`) only spawned the syncer + IMAP + SMTP servers and never started an `EventBusClient` — so the realtime push the GUI's `BridgeHandle` ships had no effect when running `cargo run` or the headless binary. Mails that arrived after a bootstrap sync were silently missed until the next restart with a forced full re-sync; that's the irritant that triggered today's WS heartbeat/timeout audit. Replicate the bridge.rs initialisation directly: build an `EventBusClient`, hydrate `last_batch_ids` from `event_bus_state` (with the same 44-day expiration guard), spawn `bus_client.run` alongside the syncer and an `event_handler::run_event_handler` to consume the mpsc, and log WsState transitions at INFO so reconnect storms are visible without `RUST_LOG=debug`. Shutdown aborts the bus + handler handles in the same Ctrl-C arm as the syncer. To avoid duplicating the model-version + client-name plumbing, the helpers `bridge::sys_model_version`, `bridge::tutanota_model_version` and `bridge::CLIENT_NAME` are now public, and the root crate gains a direct `tuta-sdk` dependency (already present transitively through `tutabridge-core`).
Languages
Rust
89.5%
TypeScript
5.9%
CSS
2.5%
Python
1.2%
Shell
0.7%
Other
0.1%