mirror of
https://github.com/chatmail/core.git
synced 2026-10-02 03:00:40 +03:00
fix: multi relay connectivity (#8550)
this PR, created together with @adbenitez, improves the connectivity state passed to UI, which has changed a lot since multi relay: - change the algorithm for `get_connectivity()`: this is roughly the "best" connectivity of all relays now, so if one is connected, we're already fine. this was discussed widely one to one, and that part already closes #8554 - the PR adds a test for that, previously, that was untested - additionally, do not regard unpublished relays in `get_connectivity()`: e.g. unpublished relays are no longer given to peers - so if only that is connected, the overall state should not be "connected". therefore, we just ignore unpublished relays there - in `get_connectivity_html()`, we continue showing unpublished relays, however, we tune them down visually and flag them as such - for the docs, remove the "range for some future use" wording. it was never used like that, and that future will probably not arrive :) <img width="320" src="https://github.com/user-attachments/assets/1805c525-72d1-4197-b865-6e2d6fbc8819" /> --------- Co-authored-by: Hocuri <hocuri@gmx.de>
This commit is contained in:
+7
-1
@@ -321,6 +321,9 @@ struct SchedBox {
|
||||
|
||||
/// IMAP loop task handle.
|
||||
handle: task::JoinHandle<()>,
|
||||
|
||||
/// Relay published status.
|
||||
is_published: bool,
|
||||
}
|
||||
|
||||
/// Job and connection scheduler.
|
||||
@@ -637,7 +640,9 @@ impl Scheduler {
|
||||
let mut inboxes = Vec::new();
|
||||
let mut start_recvs = Vec::new();
|
||||
|
||||
for (transport_id, configured_login_param) in ConfiguredLoginParam::load_all(ctx).await? {
|
||||
for (transport_id, configured_login_param, is_published) in
|
||||
ConfiguredLoginParam::load_all(ctx).await?
|
||||
{
|
||||
let (conn_state, inbox_handlers) =
|
||||
ImapConnectionState::new(ctx, transport_id, configured_login_param.clone()).await?;
|
||||
let (inbox_start_send, inbox_start_recv) = oneshot::channel();
|
||||
@@ -654,6 +659,7 @@ impl Scheduler {
|
||||
folder,
|
||||
conn_state,
|
||||
handle,
|
||||
is_published,
|
||||
};
|
||||
inboxes.push(inbox);
|
||||
start_recvs.push(inbox_start_recv);
|
||||
|
||||
Reference in New Issue
Block a user