Skip to content

fix: Allow to send to chats after failed securejoin again #6817

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

Merged
merged 1 commit into from
Apr 23, 2025

Conversation

Hocuri
Copy link
Collaborator

@Hocuri Hocuri commented Apr 23, 2025

Revert the biggest part of #6722 in order to fix #6816. Reopens #6706.

Rationale for reverting instead of fixing is that it's not trivial to implement "if the chat is encrypted, can_send() returns true": When sending a message, in order to check whether to encrypt, we load all peerstates and check whether all of them can be encrypted to (should_encrypt()). We could do this in can_send(), but this would make it quite slow for groups. With multi-transport, the ways of checking whether to encrypt will be different, so in order not to do unnecessary work now, this PR just revert parts of https://github.com/chatmail/core/pull/6722/, so that we can make things work nicely when multi-transport is merged.

As a quick mitigation, we could increase the timeout from 15s to something like 1 minute or 1 day: Long enough that usually securejoin will finish before, but short enough that it's possible to send to old chats that had a failed securejoin long in the past.

@Hocuri Hocuri force-pushed the hoc/make-securejoin-chats-readable branch from 555fe6b to 92460c1 Compare April 23, 2025 14:24
@Hocuri Hocuri changed the title [WIP] fix: Allow to send to chats after failed securejoin again fix: Allow to send to chats after failed securejoin again Apr 23, 2025
@Hocuri Hocuri requested review from r10s, adbenitez and link2xt April 23, 2025 14:26
Copy link
Collaborator

@link2xt link2xt left a comment

Choose a reason for hiding this comment

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

With #6796 we can restore it back because there is an is_encrypted function that tells if the chat is encrypted.

@Hocuri Hocuri enabled auto-merge (squash) April 23, 2025 20:44
@Hocuri Hocuri merged commit ef798cd into main Apr 23, 2025
53 of 54 checks passed
@Hocuri Hocuri deleted the hoc/make-securejoin-chats-readable branch April 23, 2025 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Existing 1:1 chats getting blocked without input bar due to expired old secure-join
3 participants