-
Notifications
You must be signed in to change notification settings - Fork 102
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
feat(tokens): migrate user added data from legacy state #3267
Conversation
…ocol/cowswap into refactor/tokens-lib-wiring
…otocol/cowswap into refactor/tokens-e2e-fix
…col/cowswap into refactor/tokens-remove-legacy
…protocol/cowswap into refactor/tokens-lib-wiring-3
…protocol/cowswap into refactor/tokens-e2e-fix
…col/cowswap into refactor/tokens-remove-legacy # Conflicts: # apps/cowswap-frontend/src/legacy/components/SearchModal/ImportList/index.tsx # apps/cowswap-frontend/src/legacy/state/lists/reducer.ts
…wprotocol/cowswap into refactor/tokens-remove-legacy
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
import { tokensLegacyStateMigration } from './migrations/tokensLegacyStateMigration' | ||
|
||
// Run migrations first of all | ||
// TODO: remove it after 30.01.2024 |
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.
I think it's enough to keep the migration for the next 3 months
…m/cowprotocol/cowswap into refactor/tokens-migrations
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.
@alfetopito it looks like an outdated state in the dev tools. Could you please try to click the refresh button? |
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.
I'm not sure if I follow correctly the steps, but it didn't work for me
- I added SHIT token in DEV: https://etherscan.io/token/0x4e4a47cAC6A28A62dcC20990ed2cdA9BC659469F
-
Exported all my local history in DEV (after adding the SHIT token)
-
Cleared the local storage in this PR
-
Imported the local storage
-
Try to navigate to SHIT. I get an IMPORT MODAL for some other Token I don't know about: SUZUME
https://swap-dev-git-refactor-tokens-migrations-cowswap.vercel.app/#/1/swap/SHIT
…cowswap into refactor/tokens-migrations
…cowswap into refactor/tokens-migrations
I tried, didn't help: Screen.Recording.2023-10-26.at.18.21.15.mov |
@alfetopito thanks! |
Summary
During the refactoring, some data was moved from redux to jotai atoms.
redux_localstorage_simple_user.tokens
->userAddedTokensAtom:v1
redux_localstorage_simple_lists
->allTokenListsInfoAtom:v2
redux_localstorage_simple_user.favouriteTokens
tofavouriteTokensAtom
. I didn't migrate them because it looks like it doesn't worth it.redux_localstorage_simple_user.pairs
was just removed, nowtokensStateAtom
performs its functions.To Test
downloadLocalStorage()
in the console (see the snipped below). It will download a file with the localStorage statevar state = <PUT_THE_FILE_CONTENT>
, press EnterlocalStorage.clear(); var stateObj = JSON.parse(state); Object.keys(stateObj).forEach(key => localStorage.setItem(key, stateObj[key]))
. It will apply the localStorage state from dev.swap.cow.fi into the current tabredux_localstorage_simple_lists
should be removed from localStorageredux_localstorage_simple_user.favouriteTokens
should be removed from localStorageredux_localstorage_simple_user.tokens
should be removed from localStorageredux_localstorage_simple_user.pairs
should be removed from localStorageDownload localStorage snippet: