Skip to content

fix(forms): improve orphaned array field guidance - #70710

Open
Deep-Axe wants to merge 3 commits into
angular:mainfrom
Deep-Axe:fix/orphan-array-field-guidance
Open

Deep-Axe wants to merge 3 commits into
angular:mainfrom
Deep-Axe:fix/orphan-array-field-guidance

Conversation

@Deep-Axe

@Deep-Axe Deep-Axe commented Sep 13, 2026

Copy link
Copy Markdown

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • CI-related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

When a previous field from a Signal Forms array becomes orphaned, NG01904 only reports that the element can no longer be found. It does not explain the supported @for tracking pattern, and it is not linked from the Error Encyclopedia.

This is particularly confusing in #70692, where a tracking expression such
as track rowField().value().score reads the previous orphaned field during @for reconciliation.

Issue Number: #70692

What is the new behavior?

NG01904 is marked as documented (-1904). The runtime message stays short and now links to a new Error Encyclopedia page:

  • adev/src/content/reference/errors/NG01904.md

That page explains array-of-object identity, the @for track field contract, and the case where a reset() flows through transformedValue() and format() allocates fresh objects.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Relates to #70692.

Point developers at field identity tracking and cover the original transformed collection reset failure.
@google-cla

google-cla Bot commented Sep 13, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@pullapprove
pullapprove Bot requested a review from JeanMeche September 13, 2026 09:40
@ngbot ngbot Bot added this to the Backlog milestone Sep 13, 2026
Comment thread packages/forms/signals/src/field/structure.ts Outdated
Comment thread packages/forms/signals/test/node/field_node.spec.ts Outdated
Comment thread packages/forms/signals/test/web/transformed_value.spec.ts Outdated
Move @for tracking guidance into the error encyclopedia and mark NG01904 as documented.

Relates to angular#70692
Document field-identity tracking with object rows, and clarify that reset through transformedValue format allocates fresh objects.
@angular-robot angular-robot Bot added the area: docs Related to the documentation label Sep 13, 2026
@Deep-Axe

Copy link
Copy Markdown
Author

@JeanMeche Resolved all comments, pls review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Related to the documentation area: forms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants