-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Surveys: Wrong graph series after changing question order #27200
Comments
Can be related to #19820 |
@lucasheriques did you check if we could use the |
@marandaneto it can't as this is a value that's computed on the client side. after it's changed in PostHog's UI, we no longer know which one was the original |
why is the API returning this value then? where does it get from? |
Bug description
related customer ticket: https://posthoghelp.zendesk.com/agent/tickets/22201
After changing the order of the questions in a survey, the graphs in the results seems to mix-up answers from different questionsAt surveys, we rely on the question index in the array to determine which question we're showing. We're sort of using it as an
id
.That means it must remain stable after launching the survey, otherwise the answers will be messed up in the data.
We did a band-aid fix to prevent re-ordering after launching a survey.
So, when we have the time, we should update our BE schema to store the questions relying on an ID instead of relying on their position in the array. This way we can again support question re-ordering after launching a survey.
Some caveats
Questions are currently stored as a JSON field in the DB.
So, if we update it to use an ID for every question, it means a breaking change in the database. So we'll have to support both versions indefinitely. Unless we come up with a better plan.
If this ID is added, we need to make sure that, on our logic, we support both survey's versions.
The text was updated successfully, but these errors were encountered: