Altinn / Altinn/app-lib-dotnet

Cannot set validation errors on Confirmation task

Open
#172 6 comments 0 reactions 0 assignees View on GitHub
kind/bug status/triage
Dominant language
C#
Stars
8
Forks
27
Avg merge
1h 21m
Merged PRs (30d)
7

Description

### Description of the bug

I would assume the metod ValidateTask in ValidationHandler is made to run validation on any task, not just the one concering filling out the form. However, when adding a modelError while on the confirmation task the form crashes (Ukjendt feil) with the following 409 network error:
`Cannot complete/close current task TaskBekreftelse. The data element(s) assigned to the task are not valid!`

### Steps To Reproduce

1. Use an app that contains a confirmation step.
2. On the confirmation step, trigger a validation error in `ValidateTask` with `validationResults.AddModelError` on a hidden field.
3. When running the app, observe that it crashes upon clicking 'confirm' on the confirmation step.

### Additional Information

Checking for e.g. outdated data on confirmation could be a real case particularly when the roles enabled to fill out a form and the ones enabled to confirm it differs.

Contributor guide

Open the contributing guide

Research direction

Start with ValidateTask in ValidationHandler and reproduce the confirmation-step case using validationResults.AddModelError on a hidden field. Trace how that result is handled when clicking confirm, then verify the chosen behavior with an app containing a confirmation step; done means the confirmation flow no longer crashes with the reported 409 error and validation remains meaningful.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.