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

Workaround to fetch all the pending toDevice events from a Synapse homeserver #4614

Merged
merged 8 commits into from
Dec 30, 2021

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Dec 1, 2021

Fixes #4612

@bmarty bmarty requested review from ganfra and BillCarsonFr December 1, 2021 23:24
@github-actions
Copy link

github-actions bot commented Dec 1, 2021

Unit Test Results

  66 files  ±0    66 suites  ±0   52s ⏱️ -7s
135 tests ±0  135 ✔️ ±0  0 💤 ±0  0 ±0 
418 runs  ±0  418 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 270c70d. ± Comparison against base commit fa256cc.

♻️ This comment has been updated with latest results.

Copy link
Member

@BillCarsonFr BillCarsonFr left a comment

Choose a reason for hiding this comment

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

I am not sure this will work for the SyncWorker (after a push?)
You might need to schedule a subsequent background sync in this case

automaticallyBackgroundSync(workManagerProvider, params.sessionId, params.timeout, params.delay, forceImmediate = hasToDeviceEvents)
} else if (hasToDeviceEvents) {
// Previous response has toDevice events, request an immediate sync request
requireBackgroundSync(workManagerProvider, params.sessionId, 0)
Copy link
Member Author

@bmarty bmarty Dec 2, 2021

Choose a reason for hiding this comment

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

This is not a workaround actually, and we should always do that, even it the bug is fixed on Synapse, WDYT @BillCarsonFr ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes (workaround is to set timeout to 0, which is probably default here ?)

We should check if we try to redecrypt existing notifications after the catchup sync?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, thanks.

We should check if we try to redecrypt existing notifications after the catchup sync?

To be honest I did not do any test, I'm just coding it. Not sure how I can reproduce the test conditions

Copy link
Member

@BillCarsonFr BillCarsonFr left a comment

Choose a reason for hiding this comment

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

Just a last comment, I noticed that on iOS when catching up we don't try ti upload new otk or to handle room key request until the catchup sync (to get all to devices) is done https://github.com/matrix-org/matrix-ios-sdk/blob/4e8db1ee5d47e7cb3bcfc4b02508c9f56996fad0/MatrixSDK/Crypto/MXCrypto.m#L931

issue ref: element-hq/element-web#2782

@bmarty
Copy link
Member Author

bmarty commented Dec 14, 2021

It will wait for the next release (1.3.11).

@bmarty
Copy link
Member Author

bmarty commented Dec 15, 2021

LGTM, @BillCarsonFr can you approve this PR please?

Copy link
Member

@BillCarsonFr BillCarsonFr left a comment

Choose a reason for hiding this comment

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

LGTM

@bmarty bmarty merged commit 3abba19 into develop Dec 30, 2021
@bmarty bmarty deleted the feature/bma/toDevice_timeout_0 branch December 30, 2021 09:28
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.

Workaround to fetch all the pending toDevice events from a Synapse homeserver
2 participants