fix: Only emit TransportsModified if transports are really modified

Otherwise it's not possible to write tests reliably because sync messages may be executed multiple
times if they arrive from different transports. This should fix flaky
`test_transport_synchronization`.

Also always emit `TransportsModified` if the primary transport is changed by a sync message, even if
it doesn't contain `SyncData::Transports`.

Also don't decrease `add_timestamp` in `save_transport()` if nothing else changes, this doesn't make
sense.
This commit is contained in:
iequidoo
2026-01-10 23:07:16 -03:00
committed by iequidoo
parent ed300b6f97
commit fe3b1ea16d
3 changed files with 25 additions and 13 deletions

View File

@@ -417,12 +417,12 @@ pub enum EventType {
chat_id: ChatId,
},
/// One or more transports has changed.
/// One or more transports has changed or another transport is primary now.
///
/// UI should update the list.
///
/// This event is emitted when transport
/// synchronization messages arrives,
/// This event is emitted when a transport
/// synchronization message modifies transports,
/// but not when the UI modifies the transport list by itself.
TransportsModified,