Repository navigation
fix(storage): clean up sync listeners and guard deferred hydration init - #1071
Conversation
🦋 Changeset detectedLatest commit: 824470f 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
|
This goes against our naming patterns. |
Problem
hydrated: true, deferred initialization can overwrite a user write made before the timer fires.Fix
[value, setter, init, dispose]frommakePersisted, following themake*naming convention requested in review. No automatic owner cleanup.disposeunsubscribes sync listeners and cancels pending initialization. Callers can opt into owner cleanup withonCleanup(dispose).multiplexSynccombines them. Custom subscriptions may also return an unsubscribe function.unchangedto preserve early writes.Test
Updated the existing regression in
persisted.test.tsto check early writes, explicit timer cancellation, multiplexed listener cleanup, and that disposing an owner does not automatically clean upmakePersisted.