-
Notifications
You must be signed in to change notification settings - Fork 38
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
Do not use Client.oneShotSync
in SSSS and bootstrap
#2028
Comments
Hey thank you for the feedback. I took a look into the code and don't yet see where this delays something. On the one hand it looks very similar to However the current approach is just to wait until the next sync is finished and then check again what we have in memory and repeat this. While this is only waiting for the next sync if account data is not updated. This does not delay anything as we have to wait for the sync anyway to continue. I don't see where this would be faster than filtering the sync stream |
Yeah, I get what you mean. I don't have an easy proposal on how to better handle this. But fact is, on a completely new account, this causes SSSS bootstrap to take 5 - 10 minutes since each and every account data change first runs into a network timeout of 40 seconds (default SDK behavior) since there is nothing to sync. One approach might be to add fake syncs to the stream similar to sending an event in a room in order to have the updated account data available immediately after it was uploaded. |
@TheOneWithTheBraid I tried now several things. I took a look into the code where we use await client.setAccountData(
client.userID!,
accountDataTypeKeyId,
content.toJson(),
);
while (!client.accountData.containsKey(accountDataTypeKeyId)) {
Logs().v('Waiting accountData to have $accountDataTypeKeyId');
await client.oneShotSync();
} I absolutely see no way how this could timeout. If the sync comes down so fast even before the Also I tried to create a complete new account and did a first bootstrap. I wasn't able to reproduce the problem. Can you maybe provide clear steps to reproduce or a minimal coding example? You could also check if you see something in the logs. Every time we call |
Checklist
In which Project did the bug appear?
Other
If you selected "Other" as Project, please enter in which project the bug occurred.
matrix-dart-sdk
On which platform did the bug appear?
Firefox
SDK Version
v0.38.0
Describe the problem caused by this bug
SSSS.createKey
,OpenSSSS.store
,Bootstrap.askSetupCrossSigning
andBootstrap.newSsss
make use ofClient.oneShotSync
. This is a huge slow down of SSSS handling since the homeserver might simply delay the/sync
request up to the local timeout if there was nothing to sync. I'd propose to rather explicitly match on whether the keys are uploaded and locally processed than waiting for a sync.Steps To Reproduce
Screenshots or Logs
No response
Security related
Just do not in-carefully change this.
The text was updated successfully, but these errors were encountered: