Skip to content
Discussion options

You must be logged in to vote

The design gap you're pointing at is real, makeDefaultStorage doesn't version its own persisted format, so a storage-layer change between major versions has no way to detect "this is data from an older, incompatible shape" versus "this is corrupt," it just tries to JSON.parse whatever's there and throws. Whether graphcache should own that detection is a fair ask, but I wouldn't wait on it landing before you need a fix, since even if it ships, it'll only cover future version bumps, not the one you're on now.

A storage-level guard you can add today without forking graphcache: wrap makeDefaultStorage in your own storage object that tracks a version marker in localStorage (synchronous, cheap …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@toerndev
Comment options

Answer selected by toerndev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants