Skip to content

feat: no unencrypted chat when securejoin times out #6722

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 1, 2025

Conversation

r10s
Copy link
Contributor

@r10s r10s commented Mar 31, 2025

this PR leaves one-to-one chats that were created by a QR code scan unwritable until e2ee is established.

the logic of the timeout is reused to show a message with additional information:

if the secure-join finishes faster than the 15 seconds, the middle message is not shown.

closes #6706

@r10s r10s force-pushed the r10s/wait-for-securejoin branch 3 times, most recently from e7756c0 to 098e7c2 Compare March 31, 2025 19:14
@r10s r10s force-pushed the r10s/wait-for-securejoin branch from c7a88ef to 83582e9 Compare March 31, 2025 23:06
@r10s r10s changed the title no unencrypted chat when securejoin times out feat: no unencrypted chat when securejoin times out Mar 31, 2025
@r10s r10s requested review from iequidoo and link2xt and removed request for iequidoo March 31, 2025 23:08
@r10s r10s marked this pull request as ready for review March 31, 2025 23:08
@r10s r10s requested a review from Hocuri March 31, 2025 23:08
instead, show a message with further information after some timeout,
but the user can send only when e2ee is actually established.
@r10s r10s force-pushed the r10s/wait-for-securejoin branch from 83582e9 to 92f27cd Compare March 31, 2025 23:11
#define DC_STR_SECUREJOIN_WAIT_TIMEOUT 191

/// "This takes longer than expected, maybe devices are offline…\n\nHowever, the process continues in background, you can do something else"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe "the peer is offline"? Otherwise it's not clear whose devices are meant and how many of them are offline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"peer" is a less known term for non-nerds than "device".

most ppl have only one device, and the message only appears after 15 seconds, so it seems none is responding - or SELF is offline

however final wording can be discussed in an android PR where i'll make the strings also translatable.

Copy link
Collaborator

Choose a reason for hiding this comment

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

What about "the device is offline" or "one of the devices is offline"? The plural also surprised me when I first read this message. I think it's clear enough which device is meant.

(but yes, the discussion here doesn't need to block merging this PR here)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's clear enough which device is meant.

which one? could be Alice's device or Bob's device

but yes, i merge this PR now and will do an android PR where for the wording

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR for the wording: deltachat/deltachat-android#3709

@r10s
Copy link
Contributor Author

r10s commented Apr 1, 2025

btw, the stock-jsonprc-strings - are they generated automatically? CI is green although one was removed, so i would assume so

@r10s r10s merged commit ee079ce into main Apr 1, 2025
29 checks passed
@r10s r10s deleted the r10s/wait-for-securejoin branch April 1, 2025 14:53
Hocuri added a commit that referenced this pull request 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/](https://github.com/chatmail/core/pull/6817#),
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.
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.

secure-join timeout is not useful for chatmail
3 participants