-
Notifications
You must be signed in to change notification settings - Fork 95
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
Conversation
The logic with the legacy store was intercepting with the rustCrypto that handles all the cases itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
4889839
to
71ff070
Compare
71ff070
to
01ad4fe
Compare
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(); |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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.
🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added: #2591
The logic with the legacy store was intercepting with the `rustCrypto that handles all the cases itself.