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

Removing variables/fields can cause Logic tab to crash #3422

Closed
LaurensBurger opened this issue Aug 25, 2023 · 4 comments · Fixed by #3454
Closed

Removing variables/fields can cause Logic tab to crash #3422

LaurensBurger opened this issue Aug 25, 2023 · 4 comments · Fixed by #3454
Assignees
Labels
bug Something isn't working
Milestone

Comments

@LaurensBurger
Copy link
Collaborator

LaurensBurger commented Aug 25, 2023

Product versie / Product version

2.3.0

Omschrijf het probleem / Describe the bug

Sentry: 337920
Utr: 112

Removing fields, groups or steps that are in use in the logic tab can cause the logic tab to crash, in turn breaking the form.
The only way to fix it is to export the form, remove logic rules that contain the unused variables and import again.

When trying to import a form in this state you see the error:
Er is iets foutgegaan bij het importeren van formulier: {'json_logic_trigger': [ErrorDetail(string='De opgegeven variabele is niet aanwezig in het formulier', code='invalid')]}

unsure about conditions on how to reproduce

@LaurensBurger LaurensBurger added bug Something isn't working triage Issue needs to be validated. Remove this label if the issue considered valid. labels Aug 25, 2023
@sergei-maertens
Copy link
Member

Refinement:

  1. We should try to reproduce this and
  2. fix the root cause and then
  3. make sure we wrap our logic rules in an ErrorBoundary to prevent the entire tab from crashing if there's an issue (these sort of bugs will probably keep happening). The error boundary needs to be set up so that we still have the icons available so any broken rule can still be removed to reduce the impact of bugs.

Possibly we could display the JSON definition as well so that it can be copy-pasted to "back up" complex rules.

@sergei-maertens
Copy link
Member

Silvia: saving the form first saves the variables and then it goes wrong in the saving of the logic rules, so this could lead to a broken state in the frontend. To confirm.

@sergei-maertens sergei-maertens removed the triage Issue needs to be validated. Remove this label if the issue considered valid. label Aug 28, 2023
@sergei-maertens
Copy link
Member

Scope this to reproducing it first and then we decide the importance/prio of a fix.

@joeribekker joeribekker added this to the Release 2.4.0 milestone Sep 4, 2023
@SilviaAmAm
Copy link
Contributor

Steps to reproduce:

  1. Create a form with 2 steps, with a textfield each.
  2. Add a logic rule: if textfield2 is equal to "bla" block going to the next step.
  3. Make this rule active only from step 2.
  4. Remove step 2.
  5. Go to the logic tab: everything disappears 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants