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

Use storage for faster calls to isLoggedIn on mobile #689

Conversation

romin-halltari
Copy link
Contributor

@romin-halltari romin-halltari commented Dec 20, 2023

📦 Pull Request

Significantly improves calls to isLoggedIn by keeping track of it by with the local storage. Check the screen recording for a demo. The code of the demo is on the Magic Lens repo, branch demo/is-logged-in.

✅ Fixed Issues

#683

🚨 Test instructions

⚠️ Don't forget to add a semver label!

Please only add one label:

  • patch: Bug Fix?
  • minor: New Feature?
  • major: Breaking Change?
  • skip-release: It's unnecessary to publish this change.
Screen.Recording.2023-12-20.at.11.55.13.AM.mov
📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @magic-ext/algorand@16.5.0-canary.689.7390316721.0
npm install @magic-ext/aptos@4.5.0-canary.689.7390316721.0
npm install @magic-ext/avalanche@16.5.0-canary.689.7390316721.0
npm install @magic-ext/bitcoin@16.5.0-canary.689.7390316721.0
npm install @magic-ext/conflux@14.5.0-canary.689.7390316721.0
npm install @magic-ext/cosmos@16.5.0-canary.689.7390316721.0
npm install @magic-ext/ed25519@12.5.0-canary.689.7390316721.0
npm install @magic-ext/flow@16.5.0-canary.689.7390316721.0
npm install @magic-ext/gdkms@4.5.0-canary.689.7390316721.0
npm install @magic-ext/harmony@16.5.0-canary.689.7390316721.0
npm install @magic-ext/icon@16.5.0-canary.689.7390316721.0
npm install @magic-ext/near@16.5.0-canary.689.7390316721.0
npm install @magic-ext/oauth@15.6.0-canary.689.7390316721.0
npm install @magic-ext/oidc@4.5.0-canary.689.7390316721.0
npm install @magic-ext/polkadot@16.5.0-canary.689.7390316721.0
npm install @magic-ext/react-native-bare-oauth@18.2.0-canary.689.7390316721.0
npm install @magic-ext/react-native-expo-oauth@18.2.0-canary.689.7390316721.0
npm install @magic-ext/solana@18.4.0-canary.689.7390316721.0
npm install @magic-ext/taquito@13.5.0-canary.689.7390316721.0
npm install @magic-ext/terra@13.5.0-canary.689.7390316721.0
npm install @magic-ext/tezos@16.5.0-canary.689.7390316721.0
npm install @magic-ext/webauthn@15.5.0-canary.689.7390316721.0
npm install @magic-ext/zilliqa@16.5.0-canary.689.7390316721.0
npm install @magic-sdk/commons@17.5.0-canary.689.7390316721.0
npm install @magic-sdk/pnp@15.6.0-canary.689.7390316721.0
npm install @magic-sdk/provider@21.5.0-canary.689.7390316721.0
npm install @magic-sdk/react-native-bare@22.5.0-canary.689.7390316721.0
npm install @magic-sdk/react-native-expo@22.5.0-canary.689.7390316721.0
npm install magic-sdk@21.5.0-canary.689.7390316721.0
# or 
yarn add @magic-ext/algorand@16.5.0-canary.689.7390316721.0
yarn add @magic-ext/aptos@4.5.0-canary.689.7390316721.0
yarn add @magic-ext/avalanche@16.5.0-canary.689.7390316721.0
yarn add @magic-ext/bitcoin@16.5.0-canary.689.7390316721.0
yarn add @magic-ext/conflux@14.5.0-canary.689.7390316721.0
yarn add @magic-ext/cosmos@16.5.0-canary.689.7390316721.0
yarn add @magic-ext/ed25519@12.5.0-canary.689.7390316721.0
yarn add @magic-ext/flow@16.5.0-canary.689.7390316721.0
yarn add @magic-ext/gdkms@4.5.0-canary.689.7390316721.0
yarn add @magic-ext/harmony@16.5.0-canary.689.7390316721.0
yarn add @magic-ext/icon@16.5.0-canary.689.7390316721.0
yarn add @magic-ext/near@16.5.0-canary.689.7390316721.0
yarn add @magic-ext/oauth@15.6.0-canary.689.7390316721.0
yarn add @magic-ext/oidc@4.5.0-canary.689.7390316721.0
yarn add @magic-ext/polkadot@16.5.0-canary.689.7390316721.0
yarn add @magic-ext/react-native-bare-oauth@18.2.0-canary.689.7390316721.0
yarn add @magic-ext/react-native-expo-oauth@18.2.0-canary.689.7390316721.0
yarn add @magic-ext/solana@18.4.0-canary.689.7390316721.0
yarn add @magic-ext/taquito@13.5.0-canary.689.7390316721.0
yarn add @magic-ext/terra@13.5.0-canary.689.7390316721.0
yarn add @magic-ext/tezos@16.5.0-canary.689.7390316721.0
yarn add @magic-ext/webauthn@15.5.0-canary.689.7390316721.0
yarn add @magic-ext/zilliqa@16.5.0-canary.689.7390316721.0
yarn add @magic-sdk/commons@17.5.0-canary.689.7390316721.0
yarn add @magic-sdk/pnp@15.6.0-canary.689.7390316721.0
yarn add @magic-sdk/provider@21.5.0-canary.689.7390316721.0
yarn add @magic-sdk/react-native-bare@22.5.0-canary.689.7390316721.0
yarn add @magic-sdk/react-native-expo@22.5.0-canary.689.7390316721.0
yarn add magic-sdk@21.5.0-canary.689.7390316721.0

Copy link

@romin-halltari romin-halltari force-pushed the rominhalltari-sc-91336-look-into-faster-calls-to-isloggedin-and branch from cb5bf3c to eb11104 Compare December 20, 2023 20:37
@romin-halltari romin-halltari force-pushed the rominhalltari-sc-91336-look-into-faster-calls-to-isloggedin-and branch from eb11104 to abb9059 Compare December 20, 2023 21:56
@romin-halltari romin-halltari added the minor Increment the minor version when merged label Dec 20, 2023
@romin-halltari romin-halltari marked this pull request as ready for review December 20, 2023 23:46
@romin-halltari romin-halltari force-pushed the rominhalltari-sc-91336-look-into-faster-calls-to-isloggedin-and branch from 9108281 to b24c775 Compare December 21, 2023 19:56
@Ethella
Copy link
Member

Ethella commented Dec 21, 2023

On another note, I think we should always store the value in a JSON format to ensure scalability for the future. But I think it's an overkill for now, as we can always switch to a new key in the storage.

@romin-halltari romin-halltari added this pull request to the merge queue Jan 2, 2024
Merged via the queue into master with commit 0546649 Jan 2, 2024
4 checks passed
@romin-halltari romin-halltari deleted the rominhalltari-sc-91336-look-into-faster-calls-to-isloggedin-and branch January 2, 2024 21:44
@Ariflo Ariflo added the released This issue/pull request has been released. label Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants