Repository navigation
fix(storage): clean up sync listeners and guard deferred hydration init - #1071
devagrawal09 wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 2dfa8d5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for solid-primitives-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
5e98ff0 to
2dfa8d5
Compare
Problem
messageSyncadds amessagelistener that is never removed, so disposed components keep receiving sync messages.hydrated: true, the deferred initialization callsset(init)without checkingunchanged, unlike the async path. A write made before the timer fires is overwritten: the signal reverts while storage keeps the user's value.Fix
messageSynckeeps its handler and removes it on cleanup.unchanged, and its timer is cleared on cleanup.Test
Added one regression to
persisted.test.ts. It fails without either fix.