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

Fix rust crypto: Don't use legacy cryptoStore anymore. #2587

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

toger5
Copy link
Contributor

@toger5 toger5 commented Aug 29, 2024

The logic with the legacy store was intercepting with the `rustCrypto that handles all the cases itself.

The logic with the legacy store was intercepting with the rustCrypto that handles all the cases itself.
Copy link
Contributor

@fkwp fkwp left a comment

Choose a reason for hiding this comment

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

lgtm

Comment on lines -187 to -195
try {
await client.store.startup();
} catch (error) {
logger.error(
"Error starting matrix client store. Falling back to memory store.",
error,
);
client.store = new MemoryStore({ localStorage });
await client.store.startup();
Copy link
Member

Choose a reason for hiding this comment

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

Ah. You've fallen into the trap of confusing client.store with client.cryptoStore. This is an understandable mistake, because the name is unclear and the documentation is, well, about as good as the rest of the documentation for the js-sdk.

client.store is used to stash things like sync results. It's totally independent of the cryptostore, and uses a separate indexeddb database.

Anyway, calling client.store.startup() is important, and you need to keep this, otherwise client.startClient() will hang. (You might reasonably ask why client.startClient doesn't call store.startup() itself. I don't know.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you so much Rich!!

This would have been a debugging session to fix this without your comment.

🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added: #2591

toger5 added a commit that referenced this pull request Aug 30, 2024
toger5 added a commit that referenced this pull request Aug 30, 2024
toger5 added a commit that referenced this pull request Aug 30, 2024
toger5 added a commit that referenced this pull request Aug 30, 2024
toger5 added a commit that referenced this pull request Aug 30, 2024
toger5 added a commit that referenced this pull request Sep 2, 2024
toger5 added a commit that referenced this pull request Sep 2, 2024
… behaviour. (#2603)

* Fix for missing client store (caused by: #2587)

* Fix interactive login with authenticated guest user.
Fix clearing storage before logging in a new account.
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.

3 participants