Skip to content

fix(measurements): persist new survey questions#819

Open
mohiuddinshahrukh wants to merge 1 commit into
hpi-studyu:devfrom
mohiuddinshahrukh:fix/measurement-question-duplication
Open

fix(measurements): persist new survey questions#819
mohiuddinshahrukh wants to merge 1 commit into
hpi-studyu:devfrom
mohiuddinshahrukh:fix/measurement-question-duplication

Conversation

@mohiuddinshahrukh
Copy link
Copy Markdown
Collaborator

What changed

Fixes the measurements survey editor so newly created questions are saved correctly and duplicated questions no longer fail.

Why

Creating a question in a brand-new measurement could appear to succeed, but the question would not remain visible because the route stayed on /measurements/new and reopened a fresh staged survey after save. Duplicating a fresh question could also fail because responseOptionsValidity was read before it had been initialized.

User impact

Users can now:

  • save a question in a newly created measurement survey and see it remain in the list
  • duplicate a newly created question without triggering a runtime error
  • continue editing on the saved measurement route instead of being reset to an empty staged survey

Root cause

There were two issues in the measurements flow:

  • question form duplication assumed responseOptionsValidity had always been initialized
  • question changes in measurement surveys needed to propagate up to the parent survey save, and new measurements needed to redirect from the temporary new route to the real measurement id after the first save

Validation

  • reproduced the failing create-and-duplicate flow from the measurements page
  • fixed the runtime crash in question duplication
  • wired question save propagation for measurement surveys
  • redirected newly saved measurements to their persisted route
  • did not run automated tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant