Skip to content
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

let UI know that a secure-join is ongoing #5475

Closed
r10s opened this issue Apr 18, 2024 · 6 comments
Closed

let UI know that a secure-join is ongoing #5475

r10s opened this issue Apr 18, 2024 · 6 comments

Comments

@r10s
Copy link
Contributor

r10s commented Apr 18, 2024

when the UI started a secure-join (via QR code or invite link), it is already allowed to write messages.

in general, this is okay - might be eg. there was anyways some chatting before, or one device is offline and one wants to get an urgent message out.

however, with chatmail, that can send only encrypted messages, sending attempts before secure-join has finished will fail, resulting in bad UX.

otoh, we should not do add much clutter to UI: if secure-join finishes fast (as it usually does), that would result in some flickering, the user has not read whatever we wrote and gets confused. therefore, the "half blocked" dialog is not really matching.

ad-hoc, the following comes to my mind UI wise:

  1. write "One moment ..." to the placeholder, but still allow tying and using attach and everything

  2. if the user really manages to text their message and hit "Sent" before secure-join finishes, show a warning "sending unencrypted messages might fail"

as a side-effect, this would also target the issue with non-chatmail, that QR code scanning still allows to send unencrypted.

that is doable UI-wise without much effort.

not, that this only affects one-to-one chats - groups are not usable anyways until secure-join is finished. with instant-onboarding allowing create-account&&secure-join in one step, this becomes even more visible

core-wise, i can imagine API as dc_chat_is_securejoin_ongoing() - but i also do not have the full picuture, maybe we already have sth?

@link2xt
Copy link
Collaborator

link2xt commented Apr 18, 2024

In case of Alice (inviter) chat is created when vc-request is received:
https://github.com/deltachat/deltachat-core-rust/blob/17701b78d6c163dda210c117aaba0d9d0566e6fe/src/securejoin.rs#L339-L343
At this point chat is already usable for Alice because Bob sends Autocrypt header in vc-request message and Alice can get public key from it to encrypt.

So this issue is only on the Bob (joiner) side and only if Bob does not have Alice's key yet.

How bad would it be if we always create the chat as hidden ("blocked") on the Bob side:
https://github.com/deltachat/deltachat-core-rust/blob/17701b78d6c163dda210c117aaba0d9d0566e6fe/src/securejoin/bob.rs#L34-L43

We already do this in case of joining a group, so maybe it is fine not to show the chat in case of setting up contact until we get some reply from Alice? Showing this chat immediately is not nice anyway because you cannot see Alice's avatar yet.

@r10s
Copy link
Contributor Author

r10s commented Apr 18, 2024

So this issue is only on the Bob (joiner) side and only if Bob does not have Alice's key yet.

yes, thanks for clarifying 👌

How bad would it be if we always create the chat as hidden ("blocked") on the Bob side [...]

that would mean, there is no feedback in case of Bob or Alice are offline?

and also no permanent state being shown in case the state does not change for minutes or hours?

tbh, i am pretty happy with the current UX element, that, after scanning an invite code, always an item is added to the chatlist

We already do this in case of joining a group

i do not think, this is true. or i misunderstood :)

i just tried: even if both, Alice and Bob are offline during scanning, Bob (the joiner) sees joined group immediately, including name. Bob cannot send and does not have member list and avatar yet, but that is a minor, compared to the really nice, intuitive instant and persistent feedback

or do you mean by 'hidden ("blocked")' the behaviour that can_send() returns false. maybe we should additionally check that the chat was started by a secure-join (or is empty beside info-messages), so failing secure-joins do not make existing one-to-ones unusable.

maybe also a timeout could do the job: after a secure-join, a chat stays inactive for a 10 seconds or until DC_EVENT_SECUREJOIN_INVITER_PROGRESS=400, that would already solve a lot of issues (but we should add some info messages as for groups: "waiting for the device of Alice to reply" ... and then either "messages are guaranteed e2ee" or, if there is no key, "Alice did not reply yet, messages will not be e2ee until Alice replies")

@iequidoo
Copy link
Collaborator

Afair, it's prohibited to send unencrypted messages only to contacts residing on other domains? So, the core should know whether sending a message would succeed (the core only should know if we use a chatmail). Maybe just gray out the Send/airplane button if so? And add a system message explaining why it's unavailable. Optionally, if we don't use a chatmail, we can display the Send button with an unlocked padlock and in another color letting the user know there will be no e2ee

@hpk42
Copy link
Contributor

hpk42 commented Apr 19, 2024 via email

@r10s
Copy link
Contributor Author

r10s commented Apr 19, 2024

How about roughly this [...]

sounds good and is what i also imagined roughly.

also great that we do not need any UI changes by that (apart from setting some stock strings)

thanks for the precise writeup, that should make implementation easy and pretty straight forward

however, i have no good idea about how to realise the timeout in rust, so that'd better be done by more rust ppl :)

@r10s
Copy link
Contributor Author

r10s commented Apr 30, 2024

i wrote the outcome of this discussion into a new issue, #5512, also thinking over events.

@r10s r10s closed this as completed Apr 30, 2024
@link2xt link2xt closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants