"You didn't submit your changes! Are you sure you want to leave?" after deleting the badge

AI-generated summary

Users reported a bug in the badges interface where deleting a badge leads to a misleading “You didn’t submit your changes! Are you sure you want to leave?” prompt, even though no changes were made. This occurs after deleting a badge, causing users to be stuck in a loop of unsaved changes warnings and broken pages. Moin demonstrated the issue, showing that navigating away results in a persistent broken badge page with new pages appearing below it. Lilly confirmed a similar experience, including a 404 error loop. The issue is being addressed by a proposed fix in pull request #28516, as noted by j.jaffeux.

Continuing the discussion from Getting rid of error message by adding image or icon instead of both:

I experimented a bit more with the badges interface and came across another problem where a broken badge edit page stayed at the top, and when I navigated somewhere else, new pages appeared below that broken one.
I can’t remember exactly how I first managed to achieve this. In any case, I was able to reproduce it with the following steps:

  1. Create a new badge
  2. Choose a status and an icon
  3. Submit the badge
  4. Edit something, for example, the status or the badge type
  5. Decide you have finished your testing, so you click the “delete” button
  6. Answer “Are you sure you want to delete the badge?” with “yes”
  7. Then you will see “You didn’t submit your changes! Are you sure you want to leave?”
    → I think this question is superfluous. Since I deleted the badge, there shouldn’t be any unsaved changes
  8. Because we are not sure which changes aren’t saved, we choose “no”
  9. Try to leave the configuration page of the new, now deleted badge. You’ll always be asked whether you are sure you want to leave. Because you are still unsure, reload the site.
  10. You will see something like
  11. When you navigate somewhere else, for example, open a different badge or click the logo to navigate to your homepage, you get the impression nothing happens, because you still see the broken badge page until you scroll down and find the working version below

4 Likes

yea I got a similar repro - i ended up stuck in the dreaded error → 404 error loop lol

4 Likes

I think this should improve the situation:

https://github.com/discourse/discourse/pull/28516

4 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.