Skip to content

Fix ComputedValue fails to trigger onBecomeObservable when used in action -> autorun - #4700

Merged
kubk merged 3 commits into
mainfrom
fix/computed-onbecomeobservable-action-autorun
Aug 20, 2026
Merged

Fix ComputedValue fails to trigger onBecomeObservable when used in action -> autorun#4700
kubk merged 3 commits into
mainfrom
fix/computed-onbecomeobservable-action-autorun

Conversation

@kubk

@kubk kubk commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Closes #3674

@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2afa3cc

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

This PR includes changesets to release 1 package
Name Type
mobx 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

@kubk
kubk requested a balanced review from Copilot August 20, 2026 08:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes lifecycle hooks when observed computed dependencies change during actions.

Changes:

  • Extends computed tracking-context handling.
  • Adds regression coverage for onBecomeObserved/onBecomeUnobserved.
  • Adds a patch changeset.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
computedvalue.ts Updates tracking-context selection.
become-observed.ts Adds lifecycle regression test.
changeset Documents the patch.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/mobx/src/core/computedvalue.ts Outdated
@kubk
kubk requested a balanced review from Copilot August 20, 2026 09:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@kubk
kubk merged commit 01211a6 into main Aug 20, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Aug 20, 2026
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.

ComputedValue fails to trigger onBecomeObservable when used in action -> autorun

2 participants