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

We don't appear to be retrying /sendToDevice requests #1866

Open
dkasak opened this issue Aug 19, 2021 · 8 comments
Open

We don't appear to be retrying /sendToDevice requests #1866

dkasak opened this issue Aug 19, 2021 · 8 comments
Labels

Comments

@dkasak
Copy link
Member

dkasak commented Aug 19, 2021

I don't think we're retrying failed /sendToDevice requests. This comment seems to agree.

This is especially bad when e.g. sharing room keys in encryptAndSendKeysToDevices since we might end up marking a key as sent to a device when in reality the request failed. Though I'm not sure whether the then(...) is executed if the request fails or not.

All call sites:

@novocaine
Copy link
Contributor

what are the consequences of this for the user?

@ara4n
Copy link
Member

ara4n commented Aug 19, 2021

to-device messages are used for setting up 1:1 olm channels; sharing new megolm sessions; requesting keyshares; and in future VoIP signalling. so if one goes missing, it could wedge the ability to send to a single device in a room (until that device spots and renegotiates, if correctly implemented), or stop the megolm session being shared with all devices in the room, killing the next ~100 msgs sent by that device (until the recipients request the sender to resend, if the sender is still online), or cause a subsequent keyshare req/response to fail.

In other words, it causes UISIs to one or more devices, which should in theory be eventually be recoverable, but may hang around for ages if the receiver tries to read the msgs after the sender has gone offline.

@novocaine
Copy link
Contributor

so the user impact of this is something like: a temporary network failure when sharing E2EE keys may stop them from ever being shared

@novocaine
Copy link
Contributor

novocaine commented Aug 19, 2021

hrm, sendToDevice returns the promise from this.http.authRequest (

public sendToDevice(
) - I think .then(...) for that object would only execute if that network request was successful..

So .. I guess the consequence might not that be that we mark the keys as sent when they weren't, but we might never run that code again in the current session?

@MadLittleMods
Copy link
Contributor

This looks related to element-hq/element-web#18666

@dkasak
Copy link
Member Author

dkasak commented Aug 24, 2021

This looks related to vector-im/element-web#18666

Is it related? That issue doesn't read to me like a bug report about not retrying failed requests, but more like a feature request to share keys with new verified devices even though keys were never shared with them in the first place.

@dkasak
Copy link
Member Author

dkasak commented Apr 19, 2022

But it is related to element-hq/element-web#12851.

@dkasak
Copy link
Member Author

dkasak commented Aug 29, 2022

This is now partially fixed by #2549 for room key sending. Other to-device messages are not retried yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants