Moving the default cashtab caching config out of Ticker.js and into its own config file.
Details
Details
- Reviewers
bytesofman Fabien - Group Reviewers
Restricted Project
- grep -r currency.defaultCashtabCache src/ and ensure no output
- npm test
- npm start with a browser with no existing cashtab cache
- upon app startup, open dev console -> Application -> IndexDB -> localforage -> keyvaluepairs and verify the cashtabCache value matches the config file
- create a new wallet, receive a token, refresh the keyvaluepairs from above and verify the ID of the token you just received is populated in cashtabCache.tokenInfoById
- close and reopen cashtab and verify the cache info from above persisted
- open cashtab on a browser with an existing wallet that has existing cashtab cache and ensure its existing keyvaluepairs have not been reset
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- caching_config
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 24174 Build 47958: Build Diff cashtab-tests Build 47957: arc lint + arc unit
Event Timeline
Comment Actions
This is certainly not a cache configuration, but default values for a cache so it doesn't belong to config/.
But first and foremost I don't understand the need for the defaultCashtabCache structure at all. What is the point of this global ? It seems to me that they should simply be initialization values for the cache variables located in the file where they are used.
cashtab/src/utils/validation.js | ||
---|---|---|
370–376 | Unrelated to this diff, but this is a nice antipattern. |
Comment Actions
The defaultCashtabCache structure is there to support the migration of legacy wallets and ensure they have the right cache attributes.
Will throw up a separate diff to address the antipattern in feedback.