Skip to content
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

Sync watcher triggering computed breaks subsequent updates #12072

Closed
skirtles-code opened this issue Sep 29, 2024 · 1 comment · Fixed by #12075
Closed

Sync watcher triggering computed breaks subsequent updates #12072

skirtles-code opened this issue Sep 29, 2024 · 1 comment · Fixed by #12075
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. scope: reactivity

Comments

@skirtles-code
Copy link
Contributor

skirtles-code commented Sep 29, 2024

Vue version

3.5.10

Link to minimal reproduction

https://play.vuejs.org/#eNqFUstu2zAQ/JUFL1ZgQY6d9mLIRh/IoT20RdvcCAQKvbaVUCTBh+NA0L9nKVqOg7xu2tmZweyILftqTLELyOasdMLWxoNDH8ySq7ox2npoweI6h/vKi20OQjcmeFxBB2urGxiRdsQVV0Ir52kdlJ/CImqy87Nn8OwF7EJD2GCZZWewWB4sil0lA8L4IE0jCbnqg2SJlUPStFwBMZXTEgupN9nIPSgxIn6EnwzGY666nE5ay+C2c0g06E6MKdPbrsYiTKPtqeKjKFE0G0TlJLVM/dLgsTGy8kgTQNsO9XXdcZgdhlgVfZU3wXut4IuQtbhbcJYUdBdbXplyktZkV05OvFnOvKNM63pT3Dqt6Gf3MaO8MbVE+9v4mjJzNk8HxF0lpb7/2WPeBswHXGxR3L2C37p9xDj7Y9Gh3SFnx52v7AZ9Wl/++4V7+j4uG70KktjvLP8i9RlixkT7FtSKYp/w+rQ/+idbq81/d7n3qNxwVAwamV3P54xe7fd3Tn+Ke1F86nX096jF6x3a6EkFXhSfi+k56x4BMKYUNg==

Steps to reproduce

Click the button.

What is expected?

  • Logging for all watchers.
  • Re-rendering.

What is actually happening?

Logging stops at pre1, with later effects not running.

System Info

No response

Any additional comments?

This is very similar to #12045, and I think the underlying cause is the same. The subscriber gets added to two different batches, resetting the next property, leading to the original batch not running to completion.

The fix for #12045, aa9ef23, solves the problem for subscribers that are effects, but not for computeds.

Running the reproduction above against 3.5.9 does result in re-rendering, but the pre2 watcher doesn't run. Running against 3.5.8 does all seem to work correctly.

@ghost

This comment was marked as spam.

@edison1105 edison1105 added scope: reactivity ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. labels Sep 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. scope: reactivity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants