camdendotlol / topstersorg

Book and music charts
https://topsters.org
GNU Affero General Public License v3.0
18 stars 9 forks source link

Bug: Opening 2 tabs of Topsters 3 can result in Data loss #35

Open MintMain21 opened 7 months ago

MintMain21 commented 7 months ago

How to recreate the bug.

  1. Open Topsters in one tab with one of two charts open.

  2. Open Topsters in another tab and open the other chart

  3. Change the other chart.

  4. Close the tab and refresh the first tab

  5. Previous chart will be overwritten with an alternate duplicate of the second chart.

Obviously Topsters was not designed to sync across two browser tabs, but this feels like an easy bug to accidentally trigger if you have poor management of your tabs or if you haven't gotten used to the new favicon.

This is also something that should be addressed before proceeding with #24 under any circumstance.

camdendotlol commented 7 months ago

https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event seems to be made for this issue.