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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element-R: Avoid uploading a new fallback key at every /sync #3338

Merged
merged 2 commits into from May 3, 2023

Conversation

florianduros
Copy link
Contributor

@florianduros florianduros commented May 2, 2023

Checklist

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

Closes element-hq/element-web#25215

At every sync, when we pass an empty set to OlmMachine::unused_fallback_keys, the fallback keys are uploaded. To avoid that, we need to pass undefined instead.


Here's what your changelog entry will look like:

馃悰 Bug Fixes

@florianduros florianduros added the T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems label May 2, 2023
@florianduros florianduros changed the title Avoid upload a new fallback key at every /sync Element-R: Avoid upload a new fallback key at every /sync May 2, 2023
@florianduros florianduros marked this pull request as ready for review May 2, 2023 16:21
@florianduros florianduros requested a review from a team as a code owner May 2, 2023 16:21
@richvdh richvdh changed the title Element-R: Avoid upload a new fallback key at every /sync Element-R: Avoid uploading a new fallback key at every /sync May 3, 2023
Comment on lines 320 to 323
events,
oneTimeKeysCounts = new Map<string, number>(),
unusedFallbackKeys = new Set<string>(),
unusedFallbackKeys,
devices = new RustSdkCryptoJs.DeviceLists(),
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't these things have type annotations? (I'm surprised our lint checks aren't picking it up 馃 )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

shouldn't these things have type annotations? (I'm surprised our lint checks aren't picking it up 馃 )

They have, receiveSyncChanges is taking an object as a parameter and the object is typed :)

https://github.com/matrix-org/matrix-js-sdk/blob/florianduros/fix/sync-unused-fallback-keys/src/rust-crypto/rust-crypto.ts#L324

Copy link
Member

Choose a reason for hiding this comment

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

oh I'm an idiot. Thanks.

@florianduros florianduros requested a review from richvdh May 3, 2023 12:43
@florianduros florianduros added this pull request to the merge queue May 3, 2023
Merged via the queue into develop with commit f3772cd May 3, 2023
36 checks passed
@florianduros florianduros deleted the florianduros/fix/sync-unused-fallback-keys branch May 3, 2023 13:23
su-ex added a commit to SchildiChat/matrix-js-sdk that referenced this pull request Dec 13, 2023
* Ensure we do not add relations to the wrong timeline ([\matrix-org#3427](matrix-org#3427)). Fixes element-hq/element-web#25450 and element-hq/element-web#25494.
* Deprecate `QrCodeEvent`, `SasEvent` and `VerificationEvent` ([\matrix-org#3386](matrix-org#3386)).
* Move crypto classes into a separate namespace ([\matrix-org#3385](matrix-org#3385)).
* Mention deno support in the README ([\matrix-org#3417](matrix-org#3417)). Contributed by @sigmaSd.
* Mark room version 10 as safe ([\matrix-org#3425](matrix-org#3425)).
* Prioritise entirely supported flows for UIA ([\matrix-org#3402](matrix-org#3402)).
* Add methods to terminate idb worker ([\matrix-org#3362](matrix-org#3362)).
* Total summary count ([\matrix-org#3351](matrix-org#3351)). Contributed by @toger5.
* Audio concealment ([\matrix-org#3349](matrix-org#3349)). Contributed by @toger5.
* Correctly accumulate sync summaries. ([\matrix-org#3366](matrix-org#3366)). Fixes element-hq/element-web#23345.
* Keep measuring a call feed's volume after a stream replacement ([\matrix-org#3361](matrix-org#3361)). Fixes element-hq/element-call#1051.
* Element-R: Avoid uploading a new fallback key at every `/sync` ([\matrix-org#3338](matrix-org#3338)). Fixes element-hq/element-web#25215.
* Accumulate receipts for the main thread and unthreaded separately ([\matrix-org#3339](matrix-org#3339)). Fixes element-hq/element-web#24629.
* Remove spec non-compliant extended glob format ([\matrix-org#3423](matrix-org#3423)). Fixes element-hq/element-web#25474.
* Fix bug where original event was inserted into timeline instead of the edit event ([\matrix-org#3398](matrix-org#3398)). Contributed by @andybalaam.
* Only add a local receipt if it's after an existing receipt ([\matrix-org#3399](matrix-org#3399)). Contributed by @andybalaam.
* Attempt a potential workaround for stuck notifs ([\matrix-org#3384](matrix-org#3384)). Fixes element-hq/element-web#25406. Contributed by @andybalaam.
* Fix verification bug with `pendingEventOrdering: "chronological"` ([\matrix-org#3382](matrix-org#3382)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Element-R: We upload a new fallback key on every /sync
2 participants