Skip to content

[BUGFIX lts] LinkTo: do not read unknown properties from models - #21771

Merged
NullVoxPopuli merged 2 commits into
emberjs:mainfrom
NullVoxPopuli-ai-agent:nvp/link-to-query-params-instanceof
Nov 2, 2026
Merged

NullVoxPopuli merged 2 commits into
emberjs:mainfrom
NullVoxPopuli-ai-agent:nvp/link-to-query-params-instanceof

Conversation

@NullVoxPopuli-ai-agent

@NullVoxPopuli-ai-agent NullVoxPopuli-ai-agent commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

<LinkTo @model={{record}}> crashes in dev builds when record is a WarpDrive record in PolarisMode:

Error: No field named isQueryParams on rental

LinkTo checks whether its last model is a QueryParams object. It does this by reading isQueryParams from the model. PolarisMode records throw when code reads a field that is not in their schema.

This PR checks 'isQueryParams' in value before it reads the property. Custom objects that set isQueryParams: true still match. WarpDrive records answer in from their schema, so they return false and do not throw.

The new test passes LinkTo a model that throws on unknown fields. It fails on main with the error above.

Found while moving the super-rentals tutorial to PolarisMode.

PolarisMode tutorial PRs

Merge in this order:

  1. Build the tutorial against ember-source main ember-learn/super-rentals-tutorial#294: builds the tutorial against ember-source main.
  2. [BUGFIX lts] LinkTo: do not read unknown properties from models #21771 (this PR): fixes <LinkTo @model={{record}}> with PolarisMode records.
  3. Use useRecommendedStore and drop @warp-drive/legacy ember-cli/ember-app-blueprint#338: new apps use useRecommendedStore without @warp-drive/legacy.
  4. Teach WarpDrive schemas in PolarisMode in chapter 11 ember-learn/super-rentals-tutorial#296: chapter 11 teaches WarpDrive schemas in PolarisMode.

Related:

🤖 Generated with Claude Code

LinkTo checked whether its last model was a QueryParams object by
reading `isQueryParams` from it. Some models throw on unknown
properties. WarpDrive records in PolarisMode do this in dev builds, so
`<LinkTo @model={{record}}>` failed with "No field named isQueryParams".

Check `instanceof QueryParams` instead. Ember no longer creates
QueryParams objects itself, and the old `(query-params)` helper created
them with `new QueryParams()`, so they still match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`instanceof QueryParams` rejected custom objects that set
`isQueryParams: true`. Check `'isQueryParams' in value` before the
read instead. WarpDrive records answer `in` from their schema and do
not throw, so they still work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NullVoxPopuli-ai-agent NullVoxPopuli-ai-agent changed the title [BUGFIX] LinkTo: do not read isQueryParams from models [BUGFIX] LinkTo: do not read unknown properties from models Oct 26, 2026
@NullVoxPopuli NullVoxPopuli changed the title [BUGFIX] LinkTo: do not read unknown properties from models [BUGFIX release] LinkTo: do not read unknown properties from models Oct 26, 2026
@NullVoxPopuli NullVoxPopuli changed the title [BUGFIX release] LinkTo: do not read unknown properties from models [BUGFIX beta] LinkTo: do not read unknown properties from models Oct 28, 2026
@NullVoxPopuli NullVoxPopuli changed the title [BUGFIX beta] LinkTo: do not read unknown properties from models [BUGFIX lts] LinkTo: do not read unknown properties from models Nov 2, 2026
@NullVoxPopuli
NullVoxPopuli merged commit d6ea9f8 into emberjs:main Nov 2, 2026
78 checks passed
@NullVoxPopuli
NullVoxPopuli deleted the nvp/link-to-query-params-instanceof branch November 2, 2026 16:10
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.

3 participants