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

KeyBackup: Disable signalling remaining keys to upload count #4010

Closed
wants to merge 1 commit into from

Conversation

BillCarsonFr
Copy link
Member

@BillCarsonFr BillCarsonFr commented Jan 17, 2024

Related to element-hq/element-web#26783 (comment)

Keys count performance can be pretty bad on some configurations (big database in FF).
For now we disable signalling the remaining key count to upload on rust crypto. (used by react sdk SecureBackupPanel.tsx to provide some feedback).

Note for reviewer:
I considered caching the count by only doing it when the backup loop is started.
The problem is that at the end of each sync you might receive some new keys and that could start a backup loop, meaning that the send performances could be degraded after each sync.
So for now, it's just disabled until we improve the store performances (count shouldn't take 10s of seconds)

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)

This change is marked as an internal change (Task), so will not be included in the changelog.

@@ -342,20 +342,29 @@ export class RustBackupManager extends TypedEventEmitter<RustBackupCryptoEvents,

if (!request || this.stopped || !this.activeBackupVersion) {
logger.log(`Backup: Ending loop for version ${this.activeBackupVersion}.`);
if (!request) {
// nothing more to upload
this.emit(CryptoEvent.KeyBackupSessionsRemaining, 0);
Copy link
Member Author

Choose a reason for hiding this comment

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

Some test relies on this event to be fired at the end of the backup loop.

Copy link
Member

Choose a reason for hiding this comment

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

this comment should probably be in the code, not the PR.

@BillCarsonFr BillCarsonFr marked this pull request as ready for review January 17, 2024 09:08
@BillCarsonFr BillCarsonFr requested a review from a team as a code owner January 17, 2024 09:08
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

lgtm but please move your comment into the code

@BillCarsonFr
Copy link
Member Author

@t3chguy @richvdh Thanks for the feedback. I created a new PR that is keeping functionality and only computing room key count if needed and once per iteration
#4015

@BillCarsonFr BillCarsonFr marked this pull request as draft January 18, 2024 13:28
@BillCarsonFr
Copy link
Member Author

Closing in favor of #4015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants