-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix: prevent re-activated stale batches from break reactivity #16959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: bf7581c 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 |
|
I still wonder if we are missing a cleanup earlier somewhere which would make this check unnecessary |
I don't think we are necessarily missing a clean-up...at most, we are doing a clean-up at the wrong time? Also weird tests are failing on node 18 while 22 and 24 works. Did something changed regarding the timing of |
This definitely feels like it's working around a bug rather than fixing it. But it's not just a cleanup issue — if you mount a component with a pending boundary, and all the This points at a design flaw in the relationship between boundaries and batches, which I've been trying to wrap my head round for a while now (but took a break from in the interests of shipping a conference talk). #16743 is another manifestation of the same flaw. I guess we need to get serious about fixing that. |
Isn't this exactly the problem? I agree this might require some different fixing that solves the issues for good, just asking to understand. |
Yeah, I'm just saying that the problem isn't that we're forgetting to unset |
Gotcha... I think this should be a p0 (maybe p1 since it's experimental) because if you happen to have a situation where promise B started after promise A resolves first, then you basically freeze reactivity without ANY errors. |
Tweaked @dummdidumm test a bit to also show how after the stale batch was
deactivated
it was basically freezing reactivity.The problem is that if a previous promise resolves after another one the previous is restored and that re-activate an already committed branch and that just lingers around preventing new batches from being created.
The check was suggested by
codex
but I spent a bit of time figuring out if it was correct, and it seems it should work since once is committed thebatch
is removed frombatches
so if acurrent_branch
is not in there it should mean that it's been committed, and it's now being re-activated.Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.packages/svelte/src
, add a changeset (npx changeset
).Tests and linting
pnpm test
and lint the project withpnpm lint