Skip to content

Conversation

@trueadm
Copy link
Contributor

@trueadm trueadm commented Oct 15, 2024

Fixes #13604.

When we mount the each block for the first time, the collection won't be connected to this effect as the effect hasn't finished running yet and its deps won't be assigned. However, it's possible that when reconciling the each block that a mutation occurred and it's made the collection MAYBE_DIRTY, so reading the collection again can provide consistency to the reactive graph again as the deriveds will now be CLEAN.

@changeset-bot
Copy link

changeset-bot bot commented Oct 15, 2024

🦋 Changeset detected

Latest commit: e0e50cc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

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

@trueadm trueadm changed the title fix: ensure bind_checked defers mutation to ensure reactive graph stability fix: ensure each block consistency to internal mutations to the collection Oct 15, 2024
@Rich-Harris
Copy link
Member

Can we simplify the test? It's hard to understand what bug this is fixing

@trueadm
Copy link
Contributor Author

trueadm commented Oct 15, 2024

Simplified the test

@trueadm trueadm merged commit 75fecf8 into main Oct 16, 2024
7 checks passed
@trueadm trueadm deleted the input-derived branch October 16, 2024 12:05
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.

Different behavior of dev and production builds (Svelte 5, Vite)

3 participants