-
Notifications
You must be signed in to change notification settings - Fork 38
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
Survey submissions show up in wrong survey #1958
Comments
This must be a bug with how data is cached in the store. When submissions have already been loaded in one survey, visiting the submissions list for another survey does not trigger submissions to be loaded anew, but just uses the same cached list. Without having looked at this yet, I would recommend that whoever takes this on starts by looking at the structure of the survey store. Submissions should be stored per survey (e.g. |
Continuing to focus on mopping up survey issues ahead of the big merge. Best to provide a nice clear landing zone for that thing. So I've been investigating your suggested fix here and there's even a From there I've been looking at everything that either reads from or writes to I wanted to get a real clear understanding of the layout of these relationships before even beginning to code. So here's a flow diagram representing the network of relationships between everything connected to the flowchart LR
subgraph store
subgraph state
submissionList
end
subgraph actions
submissionLoad
submissionLoaded
surveySubmissionUpdate
surveySubmissionUpdated
surveySubmissionsLoad
surveySubmissionsLoaded
end
end
submissionLoad --> submissionList
submissionLoaded --> submissionList
surveySubmissionUpdate --> submissionList
surveySubmissionUpdated --> submissionList
surveySubmissionsLoad --> submissionList
surveySubmissionsLoaded --> submissionList
subgraph hooks
useHydratedSurveySubmission
useSurveySubmission
useSurveySubmissions
end
useHydratedSurveySubmission --> useSurveySubmission
useSurveySubmission --> submissionList
useSurveySubmission --> submissionLoad
useSurveySubmission --> submissionLoaded
useSurveySubmission --> surveySubmissionUpdate
useSurveySubmission --> surveySubmissionUpdated
useSurveySubmissions --> submissionList
useSurveySubmissions --> surveySubmissionsLoad
useSurveySubmissions --> surveySubmissionsLoaded
subgraph components
SurveyOptionColumnType
SurveyResponseColumnType
SurveySubmittedColumnType
SurveySubmissionPane
SurveySubmissionsList
end
subgraph pages
submissions.tsx
end
submissions.tsx --> useSurveySubmissions
SurveySubmissionsList --> useSurveySubmission
SurveySubmissionPane --> useHydratedSurveySubmission
submissions.tsx --> SurveySubmissionsList
SurveyOptionColumnType --> SurveySubmissionPane
SurveySubmissionsList --> SurveySubmissionPane
SurveyResponseColumnType --> SurveySubmissionPane
SurveySubmittedColumnType --> SurveySubmissionPane
I do see the hypothetical potential for an abstraction leak in Looks to me like this is a matter of grabbing |
Description
When navigating around between surveys, without ever refreshing the page, there seems to be something wrong with the cache that is causing submissions to be rendered in the list for the wrong survey.
Steps to reproduce
Expected Behaviour
The list should contain other submissions than the one listed in step 2.
Actual Behaviour
The list is identical to the one in step 2, showing submissions of another survey than the one we are visiting. Refreshing the page shows the correct results.
Screenshots (if you have any)
Original survey
Another survey (showing same submissions)
The text was updated successfully, but these errors were encountered: