AeonSake / acnh-catalogue-issues

Issue tracker for The ULTIMATE Catalogue (https://catalogue.ac)
https://catalogue.ac
1 stars 0 forks source link

[Bug] Local storage is not properly synchronized in some scenarios #2

Open Welcius opened 3 years ago

Welcius commented 3 years ago

Describe the bug Some items marked as obtained can be lost if you have more than one tab of the Catalogue active. This has happened to me several times on different occasions during my daily use of the Catalogue so I decided to look into the real issue, since the synchronization seems to work at first glance

To Reproduce Steps to reproduce the behavior, please do not refresh the pages until I mention it

  1. Go to a list of items, for example, Materials
  2. Duplicate the current tab, so that there are two instances of the Catalogue running on different tabs, I will call those tab A and tab B: I will be assuming that you don't have any item marked as obtained, for the sake of simplicity
  3. On the tab A, mark some items as obtained, for example: Blue ornament, Gold ornament and Red ornament
  4. On the tab B, mark any item which you have marked previously in tab A as obtained. I will mark Blue ornament as obtained, for example
  5. Refresh both tabs

Expected behavior All the items marked as obtained in the tab A should be still be marked as obtained after all these steps, but they are not. In my case, after refreshing both tabs only the Blue ornament is marked as obtained, and the Gold ornament and Red ornament are now not marked as obtained.

Desktop (please complete the following information):

Additional context Seeing this specific scenario, I suspect that there could be more scenarios similar to this one while playing with checking/unchecking items between tabs. I recommend looking into a third-party library that helps synchronizing the local storage between tabs, ideally in real time.