-
-
Notifications
You must be signed in to change notification settings - Fork 112
feat: allow adding second transport #7348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9ca5385 to
d3a4eee
Compare
a288b16 to
d538e8f
Compare
b866d3e to
5d66931
Compare
5d66931 to
cbdae22
Compare
e2a6579 to
098c134
Compare
cbdae22 to
91c3957
Compare
91c3957 to
933903f
Compare
590cf06 to
22cdb13
Compare
5f75474 to
a2416ed
Compare
6151afc to
c97938e
Compare
|
This is now ready for review. It is a minimal support for multi-transport, allowing to add transports and switch between them while being connected to all of them over IMAP. It does not support synchronization, so adding transports should only be allowed when multi-device is not enabled ("bcc_self" is false). Most important to review is the SQL migration, everything else can be changed later. |
1bc4b3c to
12fb31c
Compare
| // The messages in the queue have a different | ||
| // From address so we cannot send them over | ||
| // the new SMTP transport. | ||
| transaction.execute("DELETE FROM smtp", ())?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that messages should be re-sent over the new transport. Maybe just calling chat::resend_msgs() works, it doesn't require that messages should be from the same chat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this as a TODO item to the tracking issue. Ideally we need to add another column for SMTP queue so each transport has its queue and messages are sent over secondary transports as well, but not in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the messages should get OutFailed, otherwise they'll hang forever in OutPending i guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be fixed for real by not removing them from the queue before multi-transport is marked as non-experimental. Some messages are not visible, so dropping them is a temporary solution anyway. For now it will indeed hang in the "pending" state forever (or until the user resends the message manually).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once comments are addressed; I'll approve already so that this can be merged quickly.
As far as I can see, the most important open point is whether we need to add (edit: apparently, that's not necessary)transport_id to more sql tables.
12fb31c to
14cc597
Compare
5c22a53 to
d4e183d
Compare
|
I squashed everything into a single commit now. Will merge it after reviewing it myself again and once CI passes. |
|
This could go into the commit message:
And the issue reference as well |
Tracking issue: #7357
Based on (already merged) #7424, #7413, #7406, #7392
Adding second transport is only allowed with bcc_self disabled for now, synchronization of transports will be a separate PR. This PR is fine for adding multiple transports on a single-device setup already and switching between them.
Connectivity view will display something, but extending it for multi-transport is out of scope for this PR, this is in the tracking issue.
imaptableimap_synctableconfigured_addris setimapandimap_syncentries when the transport is deletedexamples/test_examples.py::test_echo_quit_plugin(disabled it, want to finish this PR instead of debugging legacy CFFI test)configured_addris changed or keep multiple SMTP connections until SMTP queue for non-primary transports is empty