TheFive / osmbc

Open Street Map Blog Collector
MIT License
28 stars 11 forks source link

comment gets added twice when going back #914

Open Strubbl opened 2 years ago

Strubbl commented 2 years ago

e.g. https://osmbc.openstreetmap.de/article/26252

How did i do this:

  1. set article to unplished
  2. do not provide a reason
  3. enter a comment (below, so a usual article comment)
  4. hit save
  5. Now we have the comment saved.
  6. On the following page i am warned that i forget to enter an unpublish reason.
  7. So i hit the button "go back".
  8. Now we have the comment saved twice.
TheFive commented 2 years ago

I put that our of the bootstrrap 4 milestone, as the possibility to create this bug is small and the impact (one comment shown twice) is acceptable.

The issue is, that the browser first saves the comment and is then missing to refresh the page content. so that the back button of the browser or the error page is reloading the wrong content.

This can be either solved by improving the error handling (especially the back button) or ad the refresh page after comment saving.