Mantan21 / Genshin-Impact-Wish-Simulator

Best Genshin Impact Wish Simulator Website, no need to download, 100% running on browser!
https://wishsimulator.app
MIT License
197 stars 72 forks source link

Pull history and inventory disappeared #78

Open undrewatre opened 1 year ago

undrewatre commented 1 year ago

This already happened twice today, never happened before. Pull history and inventory all deleted, but only those, currency amount and pity count are still the same. I didn't reset data or clear cache on my browser. The first time it happened an error popup appeared with two buttons to refresh page or open the app.

I'm on Android 12 Edge browser 112.0.1722.59 (I used the wish simulator straight from the browser and not installing on home screen)

edit, three times. edit may 7th, happened again, also happened in another browser.

AguzzTN54 commented 1 year ago

Are you also a paimon.moe user? I use the same database that used by paimon.moe, if a similar issue also occurs, there may be a problem on your device.

I will try to add a backup-restore feature in the future, hopefully it can reduce the problem you are facing.

undrewatre commented 1 year ago

Yes, I did use paimon.moe on the Edge browser. Does it affect other browsers as well? To prevent it do I stop using paimon.moe on the same browser completely, or is it fine just as long as I don't log in?

AguzzTN54 commented 1 year ago

It's fine, this simulator is not connected to paimon.moe, so you can still use paimon.moe. I just want to confirm that you haven't encountered a similar issue on other sites.

Then, does your device have enough storage? The browser may delete data automatically due to lack of memory.

undrewatre commented 1 year ago

Oh, no I think it didn't happen to my paimon.moe data, just the simulator.

If the problem is caused by lack of storage, is it possible for it to only delete the inventory and history not also the amount of primogems+fates?

AguzzTN54 commented 1 year ago

It's possible, actually. I use Localstorage to save the site setting, and IndexedDB to save pull history, IndexedDB has bigger capacity and faster than Localstorage, so I choose it to store all the pull history. if the device doesn't have enough memory, browser will remove the largest data first, in this case is IndexedDB.

I'll write the number of items that have been obtained into localstorage in the future, (I have implemented it in the HSR Simulator). Maybe the pull history is still lost in certain situations but at least it doesn't wipe the inventory either. Another idea: I'll try to make it as Persistent Storage, but the user has to grant permission manually.