[WIP] feat: Basic multi-relay onboarding#8444
Conversation
Hocuri
commented
Jul 21, 2026
- We need a list of chatmail relays that we somehow trust, and that agree to be in the list. Then, we add all of them to the candidate list (a new SQL table with colums "domain" and "last_tried").
- Before going to IMAP IDLE: When there are less than 3 relays, fill it up with relays from the candidate list. If creating an account fails, try again with another relay from the list. For each candidate, we need to remember the last time we tried to add a transport there, and try at most once a week or so per candidate.
- For now, this will be behind an off-by-default config option, which at least DC Android will enable when creating a new profile. UIs can then opt in on their own pace but will likely need to disable it for tests. If the user manually deletes a relay, we should also disable this config option.
- Open questions: What are the backoff times? Try to add a relay at most once per hour, and try to add the same relay at most once per week?
|
This is working nicely on my Android phone already. Automated tests will be hard. I started writing a python test: Details
def test_automatic_transport_addition(acfactory, log) -> None:
alice = acfactory.new_configured_account()
# This should already add a transport:
alice.wait_for_event(EventType.TRANSPORTS_MODIFIED)
alice.set_config("automatic_transport_management")
alice.bring_online()
# 2 more transports should be added:
alice.wait_for_event(EventType.TRANSPORTS_MODIFIED)
alice.wait_for_event(EventType.TRANSPORTS_MODIFIED)
transports = alice.list_transports()
print("transports:", transports)
# TODO: Sanity-check the list of transports...then remembered that @link2xt said we shouldn't contact the other relays from the automated tests. We could just not test it automatically, and do more extensive manual testing, at the risk of more regressions. We could modify We could extract some functions from @link2xt what do you think? |
…xclude candidates that are already in use
72bbefb to
e220029
Compare
|
Some more options for writing tests:
I will look at these options again tomorrow, and maybe @link2xt has commented by then. |