Skip to content

Handle null intermediate model slots during path reads - #47

Closed
pkaminski wants to merge 2 commits into
masterfrom
codex/firetruss-null-path-read
Closed

pkaminski wants to merge 2 commits into
masterfrom
codex/firetruss-null-path-read

Conversation

@pkaminski

@pkaminski pkaminski commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Firetruss inserts a null slot before constructing a model. A reactive lookup of a descendant during that interval dereferenced the null slot as a model. A lookup below the slot now returns undefined and retains the reactive read that can observe its replacement. A lookup of the slot itself still returns null.

The regression reproduces the exception before the change and verifies that the same lookup returns the value once the model is populated. All 80 Firetruss tests passed. Lint and distribution generation completed. The package version is 8.3.1.

Sentry

The application still needs to consume and deploy a release containing this change before either SaaS issue can be resolved.


This change is Reviewable

@pkaminski pkaminski left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@pkaminski reviewed 9 files and all commit messages.
Reviewable status: 0 of 9 files reviewed, all discussions resolved (waiting on pkaminski).

@pkaminski
pkaminski marked this pull request as ready for review November 8, 2026 23:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T23:34:24.753522Z fa3dd09 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Devin Review

Comment thread src/Tree.test.js Outdated
Comment on lines +110 to +114
assert.equal(tree.getObject('/foo'), null);
assert.equal(tree.getObject('/foo/bar'), undefined);

tree._plantValue('/foo', 'foo', {bar: 'ready'}, tree.root, false, false, false, []);
assert.equal(tree.getObject('/foo/bar'), 'ready');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Reactive recovery lacks a watcher test

The test calls getObject twice, but never observes it through Vue. A watcher test can verify that replacing the null slot triggers the descendant read again.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated the regression test in fa3dd09. A model's beforeCreate hook registers a Vue watcher while _plantValue() has the parent slot set to null. The watcher initially reports undefined for the descendant, then reports 'ready' after Vue.nextTick() once the snapshot is integrated. All 80 tests and lint passed. Removing the null guard reproduced the $data TypeError in this test.

@pkaminski pkaminski left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@pkaminski made 1 comment.
Reviewable status: 0 of 9 files reviewed, 1 unresolved discussion.


src/Tree.js line 600 at r1 (raw file):

    for (const segment of segments) {
      // An intermediate model can still be a null placeholder during creation.
      if (segment && object === null) return;

Point me to where we create null placeholders.

@pkaminski pkaminski left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@pkaminski+CODX made 2 comments and resolved 1 discussion.
Reviewable status: 0 of 9 files reviewed, all discussions resolved.


src/Tree.js line 600 at r1 (raw file):

Previously, pkaminski (Piotr Kaminski) wrote…

Point me to where we create null placeholders.

Tree._plantValue() in src/Tree.js sets the parent's child slot to null just before _createObject(), then replaces it with the new model. The temporary reactive slot lets $$touchThis() subscribe through the parent while the model is being created.

Comment thread src/Tree.test.js Outdated
Comment on lines +110 to +114
assert.equal(tree.getObject('/foo'), null);
assert.equal(tree.getObject('/foo/bar'), undefined);

tree._plantValue('/foo', 'foo', {bar: 'ready'}, tree.root, false, false, false, []);
assert.equal(tree.getObject('/foo/bar'), 'ready');

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated the regression test in fa3dd09. A model's beforeCreate hook registers a Vue watcher while _plantValue() has the parent slot set to null. The watcher initially reports undefined for the descendant, then reports 'ready' after Vue.nextTick() once the snapshot is integrated. All 80 tests and lint passed. Removing the null guard reproduced the $data TypeError in this test.

@pkaminski pkaminski left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@pkaminski reviewed 1 file and all commit messages.
Reviewable status: 0 of 9 files reviewed, all discussions resolved.

@pkaminski
pkaminski requested a review from snoack November 8, 2026 23:35
@pkaminski pkaminski closed this Nov 8, 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.

1 participant