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

Surveys: Editing a survey question for a long time makes it disappear when saving #2510

Open
ziggabyte opened this issue Jan 31, 2025 · 2 comments
Assignees
Labels
🐜 bug Something isn't working 🚪 entry-level Good for newcomers 🐟 Small Should be a quick-ish fix.

Comments

@ziggabyte
Copy link
Contributor

ziggabyte commented Jan 31, 2025

Description

When you create a survey, sometimes you need to spend some time to create or edit the survey questions - they might need a lot of context, or precise instructions to get the most precise responses.

Currently when you do spend some time creating a survey question, and then click outside to save it, the text content you worked so hard on, disappears. If you are instead editing an existing survey question, it gets reset back to its old content. Frustrating!

Steps to reproduce

  1. Go to a project and create a survey from the "Create" button in the top right corner
  2. Add a question of any sort
  3. Spend a long time (reports from organisers estimates it happens when they spend more than 1 minute in writing) writing the question
  4. Click outside the "card" to save the question
  5. Repeat step 3-5 but with editing an existing question, instead of having created a new one.

Expected Behaviour

Clicking outside to save, saves the new text content of the survey question

Actual Behaviour

Clicking outside to save resets the text field to its initial state, and this is what gets saved to the survey question

Screenshots (if you have any)

@ziggabyte ziggabyte added 🐜 bug Something isn't working 🐟 Small Should be a quick-ish fix. 🚪 entry-level Good for newcomers labels Jan 31, 2025
@richardolsson
Copy link
Member

The only reason I can think of (which does not mean it's the only possible solution) is that the in-memory cache that we keep in redux "expires" and triggers a reload or something. That would happen after 5 minutes, I believe. If that's the offender, changing shouldLoad() to use a shorter TTL could make this bug easier to reproduce.

@a-jaxell
Copy link
Collaborator

a-jaxell commented Feb 1, 2025

By setting the DEFAULT_TTL to a shorter value as you suggested @richardolsson I've managed to recreate this bug.

I am unsure on how to solve this bug though.

Im looking into solving this, either component by component or for the parent component.

@a-jaxell a-jaxell self-assigned this Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐜 bug Something isn't working 🚪 entry-level Good for newcomers 🐟 Small Should be a quick-ish fix.
Projects
None yet
Development

No branches or pull requests

3 participants