Once I added cryptoStore to the redux-persist "whitelist," I noticed that refreshing the page caused an error. The error had to do with olm.Account() not being a constructor. After looking into it, I realized that the issue was that we weren't awaiting initOlm in getSignedIdentityKeysBlobSelector before trying to use olm functions.
Why wasn't this an issue before?
Previously, the only places on web where we were using olm were LoginForm, TraditionalLoginForm, and SIWELoginForm.
In all of those places we made sure that await initOlm had completed prior to using any olm functionality (either explicitly in LoginForm, or implicitly in the child TraditionalLoginForm and SIWELoginForm components) so this was never an issue.
I failed to ensure that we were handling await initOlm() when writing getSignedIdentityKeysBlobSelector. This caused a crash on refresh because the olm codepaths in getSignedIdentityKeysBlobSelector get "hit" immediately as part of Socket "rendering."
The reason I wasn't catching this previously is
A. I either had OLM initialized after authing in... so things worked.
B. primaryAccount/primaryIdentityKeys/notificationIdentityKeys were unset because they weren't persisted, and getSignedIdentityKeysBlobSelector early returned:
... so things worked.
Once I added cryptoStore to redux-persist, I ran into the situation where
A. OLM hadn't been initialized.
B. getSignedIdentityKeysBlobSelector was getting past the early return case... and the new olm.Account() call failed.
In this diff I add await initOlm() to getSignedIdentityKeysBlobSelector and make the necessary modifications in TraditionalLoginForm and SIWELoginForm to accomodate the changes.