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

US-1964 WalletConnect sessions don't get erased when the wallet is reset #900

Merged
merged 8 commits into from
Mar 29, 2024

Conversation

TravellerOnTheRun
Copy link
Collaborator

No description provided.

src/storage/MMKVStorage.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@Freshenext Freshenext left a comment

Choose a reason for hiding this comment

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

This PR is changing a few things out of the scope of the ticket, like transforming all the address references from the wallet to the addressToUse function.

I guess this is okay, only one thing that has to be addressed. What I suggest is that we don't modify anything related to the mmkv storage, instead, focus on deleting the wallet connect mmkv storage when the wallet is reset.

src/storage/MMKVStorage.ts Outdated Show resolved Hide resolved
@TravellerOnTheRun
Copy link
Collaborator Author

@jessgusclark @Freshenext
Renamed the storage back


export const getCurrentChainId: () => ChainID = () =>
ChainStorage.get('chainId') || 31
MainStorage.get('chainId') || 31
Copy link
Collaborator

@Freshenext Freshenext Mar 5, 2024

Choose a reason for hiding this comment

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

Why is this ChainStorage being changed to MainStorage? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because there was no need to do a separate instance just for chainId

Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you tested to make sure that testnet and mainnet switch are working ok?
And also wallet reset on testnet
And also wallet reset on mainnet

I ask because changing it could potentially alter the behavior of the wallet

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We're calling getCurrentChainId everytime when we need to fetch chainId

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Video proof

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-03-06.at.12.36.21.mp4

Copy link
Collaborator

@Freshenext Freshenext left a comment

Choose a reason for hiding this comment

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

Looks good.
Tested and the WC session is deleted.

Copy link
Contributor

@jormelCoin jormelCoin left a comment

Choose a reason for hiding this comment

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

works as expected ✅

@jormelCoin jormelCoin added Tested Ready to move forward and removed Ready for Testing labels Mar 21, 2024
Copy link
Member

@jessgusclark jessgusclark left a comment

Choose a reason for hiding this comment

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

I made one change to where a variable was being pulled from, but it works as expected.

@@ -21,7 +22,8 @@ import {
import { useAppDispatch, useAppSelector } from 'store/storeUtils'
import { selectChainId } from 'store/slices/settingsSlice'
import { addPendingTransaction } from 'store/slices/transactionsSlice'
import { createPendingTxFromTxResponse } from 'src/lib/utils'
import { Wallet } from 'shared/wallet'
import { addressToUse } from 'shared/hooks'
Copy link
Member

Choose a reason for hiding this comment

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

import { addressToUse } from 'shared/wallet'

@jessgusclark jessgusclark merged commit a62861d into develop Mar 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tested Ready to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants