Repository navigation
Fix localStorage quota error in asset metadata cache - #479
Conversation
Asset metadata icons are base64-encoded image strings that can be tens or hundreds of KB each. Persisting them fills up the ~5MB localStorage quota unnecessarily since they are re-fetched on demand. The hasIcon flag is preserved so the UI still knows an icon exists. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entries older than 24h (ASSET_METADATA_TTL_MS) are now dropped when persisting the cache to localStorage, preventing unbounded growth. The TTL constant is shared between storage.ts and wallet.tsx. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WalkthroughThese changes refactor the asset metadata cache TTL constant from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying wallet-bitcoin with
|
| Latest commit: |
527e249
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3db22699.wallet-bitcoin.pages.dev |
| Branch Preview URL: | https://fix-localstorage-quota-asset.wallet-bitcoin.pages.dev |
🔍 Arkana Review —
|
Deploying wallet-mutinynet with
|
| Latest commit: |
527e249
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://476b861e.arkade-wallet.pages.dev |
| Branch Preview URL: | https://fix-localstorage-quota-asset.arkade-wallet.pages.dev |
Keep icons persisted in localStorage; only rely on TTL-based eviction to control cache size. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
🔍 Review —
|
Summary
ASSET_METADATA_TTL_MSinto a shared constant instorage.tsFixes:
Failed to execute 'setItem' on 'Storage': Setting the value of 'config' exceeded the quota.The
configkey itself is small, butassetMetadataCachewas filling up the ~5MB localStorage quota with large icon strings and never-evicted entries, causing subsequent writes (includingconfig) to fail.Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests