Altinn / Altinn/app-lib-dotnet

`RemoveHiddenDataPreview` with hidden repeating group sets row values to `null` instead of deleting rows

Open
#321 0 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

When setting `RemoveHiddenDataPreview` to `true` and hiding a repeating group, it might be expected that the repeating group is deleted (i.e. that all rows disappear), but instead the rows are kept and all values (leaf nodes) in the repeating structure are set to `null`.

This caused problems when receiving data on the other end for at least one customer, as null values here are not valid according to the data model.

### Steps To Reproduce

1. Open `mat/lakselus-rapportering`
2. Fill out the form, say you have at least one 'behandling'
3. Add at least one row in the 'behandlinger' repeating group
4. Regret your decision and say don't have any 'behandlinger' (thereby hiding the repeating group)
5. Submit the form
6. Observe the null-ed out rows in the data model

### Additional Information

- https://altinn.slack.com/archives/C047F8FK2NQ/p1697008355300669

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior in mat/lakselus-rapportering by enabling RemoveHiddenDataPreview, adding a behandlinger row, hiding the repeating group, and submitting the form. Trace the code that processes hidden repeating groups and verify the completed data model contains no rows rather than rows whose leaf values are null.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.