Skip to content

Conversation

@link2xt
Copy link
Collaborator

@link2xt link2xt commented Nov 21, 2025

The last commits adds actual transport synchronization, commits before split into PR #7530 are refactorings and preparation.

New TransportsModified event is meant for tests, it is currently emitted when sync message is received and not when the user changes the transports manually as it is already known to the UI.

Transport with ID 1 is never synced except for deletion to avoid ever sending the credentials of the first transport to other email servers. The only downside is that if the password is changed, the user will have to change it on all devices, but this avoids all the discussion of reducing security compared to the current state. The first transport with multi-transport is handled he same way as before without multi-transport.

@link2xt link2xt mentioned this pull request Nov 21, 2025
6 tasks
@link2xt link2xt force-pushed the link2xt/transport-sync branch 13 times, most recently from 1e4a729 to 3b2f96a Compare November 27, 2025 00:11
@link2xt link2xt force-pushed the link2xt/transport-sync branch 6 times, most recently from 7baac2d to 7c28f2c Compare November 27, 2025 18:01
@link2xt link2xt changed the title WIP: synchronization of transports Synchronization of transports Nov 27, 2025
@link2xt link2xt marked this pull request as ready for review November 27, 2025 18:06
@link2xt link2xt force-pushed the link2xt/transport-sync branch from 7c28f2c to fb9a033 Compare November 27, 2025 20:53
@link2xt link2xt changed the base branch from main to link2xt/transport-sync-prepare November 27, 2025 22:56
@link2xt link2xt force-pushed the link2xt/transport-sync-prepare branch from 759f4ba to e6a2d94 Compare November 27, 2025 22:59
@link2xt link2xt force-pushed the link2xt/transport-sync branch from fb9a033 to aa10a3d Compare November 27, 2025 22:59
@link2xt link2xt force-pushed the link2xt/transport-sync-prepare branch from e6a2d94 to 4fa2153 Compare November 28, 2025 02:15
@link2xt link2xt force-pushed the link2xt/transport-sync branch from aa10a3d to 7ec3e47 Compare November 28, 2025 02:15
Base automatically changed from link2xt/transport-sync-prepare to main November 29, 2025 00:17
@iequidoo
Copy link
Collaborator

New TransportsModified event is meant for tests, it is currently emitted when sync message is received and not when the user changes the transports manually as it is already known to the UI.

I don't remember where exactly, but it was discussed that for the UI code it's easier to do everything on events rather then to handle also UI-triggered config changes. But if this event is only for tests, that doesn't matter probably.

/// Removes the transport with the specified email address
/// (i.e. [EnteredLoginParam::addr]).
pub async fn delete_transport(&self, addr: &str) -> Result<()> {
let now = time();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be max(time(), add_timestamp) so that the deletion "wins" on all devices?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added separate commit for easier review, will squash it later: 7d3628e

@link2xt link2xt force-pushed the link2xt/transport-sync branch from 7ec3e47 to b5fea77 Compare November 30, 2025 01:47
@adbenitez
Copy link
Collaborator

adbenitez commented Dec 1, 2025

New TransportsModified event is meant for tests, it is currently emitted when sync message is received and not when the user changes the transports manually as it is already known to the UI.

not really, ex. if user has the transports list open to check transport is synchronized, and adds a transport in another device, the list will not be refreshed, user will need to close and open again for the list to refresh, a minor tho

btw, I guess changing/marking the main transport should also be synchronized, is that the case? (sorry for not trying to dive into the rust code to figure out)

@link2xt
Copy link
Collaborator Author

link2xt commented Dec 2, 2025

not really, ex. if user has the transports list open to check transport is synchronized, and adds a transport in another device, the list will not be refreshed, user will need to close and open again for the list to refresh, a minor tho

I also think refreshing the list while you are editing it is going to cause more troubles than be useful. I don't expect users to edit transports from two devices simultaneously. Will mark the event clearly as an event that is for testing only.

btw, I guess changing/marking the main transport should also be synchronized, is that the case? (sorry for not trying to dive into the rust code to figure out)

Yes, it is synchronized. Not explicitly, but just when you receive a sync message, the address is changed to the one that sync message comes from. The test checks that this works.

@link2xt link2xt force-pushed the link2xt/transport-sync branch from b5fea77 to 38eac74 Compare December 2, 2025 15:44
@link2xt link2xt marked this pull request as draft December 2, 2025 15:52
@link2xt link2xt force-pushed the link2xt/transport-sync branch 3 times, most recently from 4f73fb5 to 8f3415b Compare December 2, 2025 21:17
@link2xt link2xt marked this pull request as ready for review December 2, 2025 21:27
@link2xt link2xt force-pushed the link2xt/transport-sync branch from 8f3415b to 6fcd396 Compare December 3, 2025 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants