Repository navigation
Description
Description of the bug
A save only returns issues from the validators that ran. A custom validator whose HasRelevantChanges returns false is left out of the response. Since #3753 (October 2025), useUpdateIncrementalValidations rebuilds the backend validations from the cached initial validations and the last save only. So when the user saves a field that runs another validator, an error from an earlier save disappears from the form. The backend still has the error and blocks submit, but the user no longer sees why.
This is the bug from #1848, which #1865 fixed in 2024. Before #3753, BackendValidation.tsx kept the validator groups between saves in a ref. #3753 moved the incremental update into a hook that starts from the cached initial validations every time.
Expected: an error from a validator that did not run on the last save stays until that validator runs again, or the initial validations are fetched again.
Steps To Reproduce
- Make an app (Altinn.App 8, app-frontend v4) with two
IFormDataValidators, one for a phone number field and one for an email field. Each returnstruefromHasRelevantChangesonly when its own field has changed. The phone validator returns an error when the phone number is123. - Type
123in the phone number and leave the field. The save returns the error from the phone validator, and it is shown under the field. - Change the email and leave the field. The save returns only the email validator, with no issues.
- The phone number error is gone from the form.
GET /instances/{id}/validatestill returns it, andprocess/nextanswers 409 «Validation failed for task» with the same issue.
The error only disappears when the save returns at least one other validator. If no validator runs, the frontend skips the update and the error stays.
Additional Information
Seen on 16 October 2026 with app-frontend 4 from the CDN, and with main (3ef668f) built locally and loaded through localtest's frontendVersion cookie.
After step 2:
After step 3:
In Nordre Follo kommune we have about 80 apps on Altinn.App 8 and app-frontend v4. 38 of our validators run on save. 36 of them return true from HasRelevantChanges so that their errors are not lost, which means they run on every save. The other two are in apps that have no other validator that runs on save, so they are not hit today.
I have a fix with tests and will open a PR that refers to this issue. v9 (src/App/frontend in altinn-studio) builds the validations the same way, also for component validations.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields✅ Done
Activity
olemartinorg commentedon Oct 20, 2026
Thanks for the detailed report, both PRs, and the regression tests! We’ve reviewed the v4 fix and confirmed your diagnosis.
Our existing Cypress test returns no validator groups on the later save, which skips the update and hides the bug. It misses the case where another validator returns a group.
We’ll follow up with a separate PR in the v9 monorepo to cover successive saves with different validators, including preserving skipped validators’ errors and clearing them when their validator runs again without issues.