Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(legacy) Object API registration: json_summary contains "duplicate" nodes #5035

Closed
LaurensBurger opened this issue Jan 24, 2025 · 0 comments · Fixed by #5043
Closed

(legacy) Object API registration: json_summary contains "duplicate" nodes #5035

LaurensBurger opened this issue Jan 24, 2025 · 0 comments · Fixed by #5043
Assignees
Labels
needs-backport Fix must be backported to stable release branch
Milestone

Comments

@LaurensBurger
Copy link
Collaborator

Product versie / Product version

3.0.1

Customer reference

DH

Omschrijf het probleem / Describe the bug

The object API v1 json_summary seem to include the entire form in the first "step" with no values. But also includes each step with the data entered into the submission:

example:

    "record": {
        "typeVersion": 1,
        "data": {
            "data": {
                "step1: {
                    "buitenNederland": "JA",
                    "verzoek": {
                        "LTKnummer": "",
                        "HuidigeGeslachtsaanduiding": "MAN",
                        "voornaamWijzigen": "JA",
                        "voornamenWijzigen": "piet"
                    },
                    "_comment": "the following key's are not present in step 1 in the form",
                    "gegevensAanvrager": {
                        "Achternaam": "",
                        "tussenvoegselS": "",
                        "voorletterS": "",
                        "voornamen": "",
                        "BurgerServicenummer": "",
                        "Geboortedatum": "",
                        "geboorteland": "",
                        "Geboorteplaats": "",
                        "nationaliteit": ""
                    },
                    "oudersGetrouwd": "",
                    "huwelijkOuders": {
                        "datumHuwelijk": "",
                        "plaatsHuwelijk": "",
                        "landHuwelijk": ""
                    },
                    "bentUGeadopteerd": "",
                    "correspondentieadres": {
                        "Straat": "",
                        "Huisnummer": "",
                        "Huisletter": "",
                        "extraAdresregel": "",
                        "postcode": "",
                        "Woonplaats": "",
                        "land": "",
                        "eMailadres": "",
                        "telefoonnummer": ""
                    },
                    "UploadBijlagen1": [],
                    "UploadBijlagen2": [],
                    "UploadBijlagen3": [],
                    "UploadBijlagen4": []
                },
                "stap2": {
                    "gegevensAanvrager": {
                        "Achternaam": "uyuyt",
                        "tussenvoegselS": "",
                        "voorletterS": "jh",
                        "voornamen": "hg",
                        "BurgerServicenummer": "",
                        "Geboortedatum": "2025-01-01",
                        "geboorteland": "aaa",
                        "Geboorteplaats": "greg",
                        "nationaliteit": "reg"
                    },
                    "oudersGetrouwd": "NEE",
                    "huwelijkOuders": {
                        "datumHuwelijk": "",
                        "plaatsHuwelijk": "",
                        "landHuwelijk": ""
                    },
                    "bentUGeadopteerd": "JA",
                    "correspondentieadres": {
                        "Straat": "htrh",
                        "Huisnummer": "4",
                        "Huisletter": "",
                        "extraAdresregel": "",
                        "postcode": "1234aa",
                        "Woonplaats": "adsasdasd",
                        "land": "Nederland",
                        "eMailadres": "[email protected]",
                        "telefoonnummer": "xxxxxxxxxxx"
                    }
                },
                "bijlagen": {
                    "UploadBijlagen1": [
                        {
                            "url": "htt..."
                        }
                    ],
                    "UploadBijlagen2": [
                        {
                            "url": "htt..."
                        }
                    ],
                    "UploadBijlagen3": [
                        {
                            "url": "htt..."
                        }
                    ],
                    "UploadBijlagen4": [
                        {
                            "url": "htt..."
                        }
                    ]
                }
            }

Stappen om te reproduceren / Steps to reproduce

No response

Verwacht gedrag / Expected behavior

No response

Screen resolution

None

Device

None

OS

None

Browser

No response

@LaurensBurger LaurensBurger added the triage Issue needs to be validated. Remove this label if the issue considered valid. label Jan 24, 2025
@vaszig vaszig removed the triage Issue needs to be validated. Remove this label if the issue considered valid. label Jan 27, 2025
@vaszig vaszig added this to the Release 3.0.2 milestone Jan 27, 2025
@sergei-maertens sergei-maertens moved this from Todo to In Progress in Development Jan 27, 2025
sergei-maertens added a commit that referenced this issue Jan 27, 2025
…cords

Components nested in repeating groups are not real variables. The
frontend code showed these in the variables table AND this also
caused them to be PUT to the backend, resulting in crashes when
processing file uploads because there are no saved submission variables
available for them.

Unfortunately, this doesn't appear to fix the problem with too much
keys being included in the submission data during registration, so
it must have a different root cause.
@sergei-maertens sergei-maertens added the needs-backport Fix must be backported to stable release branch label Jan 27, 2025
sergei-maertens added a commit that referenced this issue Jan 27, 2025
sergei-maertens added a commit that referenced this issue Jan 27, 2025
…ep configuration

The total configuration wrapper merges the configuration wrapper of
each step into a single object for optimized access to values/
components. It takes the first step and merges the remaining steps into
it. However, this had the unintended side-effect of mutating the config
of the first step, manifesting in the objects API v1 registration with
the json_summary tag which contained extra, unexpected keys in the
submission data of the first step.

Fixed by making a deep copy first to end up with a different instance
that can be safely mutated.
@sergei-maertens sergei-maertens moved this from In Progress to Implemented in Development Jan 27, 2025
sergei-maertens added a commit that referenced this issue Jan 28, 2025
…cords

Components nested in repeating groups are not real variables. The
frontend code showed these in the variables table AND this also
caused them to be PUT to the backend, resulting in crashes when
processing file uploads because there are no saved submission variables
available for them.

Unfortunately, this doesn't appear to fix the problem with too much
keys being included in the submission data during registration, so
it must have a different root cause.
sergei-maertens added a commit that referenced this issue Jan 28, 2025
sergei-maertens added a commit that referenced this issue Jan 28, 2025
…ep configuration

The total configuration wrapper merges the configuration wrapper of
each step into a single object for optimized access to values/
components. It takes the first step and merges the remaining steps into
it. However, this had the unintended side-effect of mutating the config
of the first step, manifesting in the objects API v1 registration with
the json_summary tag which contained extra, unexpected keys in the
submission data of the first step.

Fixed by making a deep copy first to end up with a different instance
that can be safely mutated.
@github-project-automation github-project-automation bot moved this from Implemented to Done in Development Jan 28, 2025
sergei-maertens added a commit that referenced this issue Jan 28, 2025
Fix 1:

Components nested in repeating groups are not real variables. The
frontend code showed these in the variables table AND this also
caused them to be PUT to the backend, resulting in crashes when
processing file uploads because there are no saved submission variables
available for them.

Unfortunately, this doesn't appear to fix the problem with too much
keys being included in the submission data during registration, so
it must have a different root cause.

Fix 2:

Avoid the total configuration wrapper mutating the first step configuration

The total configuration wrapper merges the configuration wrapper of
each step into a single object for optimized access to values/
components. It takes the first step and merges the remaining steps into
it. However, this had the unintended side-effect of mutating the config
of the first step, manifesting in the objects API v1 registration with
the json_summary tag which contained extra, unexpected keys in the
submission data of the first step.

Fixed by making a deep copy first to end up with a different instance
that can be safely mutated.

Backport-of: #5043
sergei-maertens added a commit that referenced this issue Jan 28, 2025
Fix 1:

Components nested in repeating groups are not real variables. The
frontend code showed these in the variables table AND this also
caused them to be PUT to the backend, resulting in crashes when
processing file uploads because there are no saved submission variables
available for them.

Unfortunately, this doesn't appear to fix the problem with too much
keys being included in the submission data during registration, so
it must have a different root cause.

Fix 2:

Avoid the total configuration wrapper mutating the first step configuration

The total configuration wrapper merges the configuration wrapper of
each step into a single object for optimized access to values/
components. It takes the first step and merges the remaining steps into
it. However, this had the unintended side-effect of mutating the config
of the first step, manifesting in the objects API v1 registration with
the json_summary tag which contained extra, unexpected keys in the
submission data of the first step.

Fixed by making a deep copy first to end up with a different instance
that can be safely mutated.

Backport-of: #5043
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-backport Fix must be backported to stable release branch
Projects
Archived in project
3 participants