Skip to content

fix(storage): migrations incorrectly running#2130

Open
42willow wants to merge 3 commits intowxt-dev:mainfrom
42willow:fix/migration-init
Open

fix(storage): migrations incorrectly running#2130
42willow wants to merge 3 commits intowxt-dev:mainfrom
42willow:fix/migration-init

Conversation

@42willow
Copy link
Contributor

@42willow 42willow commented Feb 14, 2026

follow up of #1996, which wasn't effective because of this commit c4577d7 (sorry I didn't test this properly with my extension first...)

turns out there was a reported issue for this! #1775

* when items initiated at v >= 2
@netlify
Copy link

netlify bot commented Feb 14, 2026

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit b84e030
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/69903a3cfec45a0008138893
😎 Deploy Preview https://deploy-preview-2130--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@42willow 42willow marked this pull request as ready for review February 14, 2026 09:02
@42willow
Copy link
Contributor Author

@aklinker1 i think there was some confusion in the previous PR (#1996 (comment) and #1996 (comment))

By "migrations incorrectly running on initialisation" I mean they are incorrectly running when a value is first set in local storage, not necessarily from the init function. I have moved the fix to the migration logic as getOrInitValue runs after migrations have completed which makes things confusing as the first time around the version is not set in meta, causing the test, specifically at this line to fail.

@absdjfh explains it well in #1775

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Meta is not set when storage item with migrations defined is initially created

1 participant