democratizedspace / dspace

Free, open source space exploration idle game. Build your home base on earth, gather resources, and launch into orbit.
https://democratized.space
BSD Zero Clause License
3 stars 2 forks source link

v1->v2 importer fails on `item-n-cooldown` keys #51

Closed futuroptimist closed 1 year ago

futuroptimist commented 1 year ago

I’m not sure how widespread this is yet, but I was able to reproduce it on my phone and someone else’s phone. To be clear, it seems to be something in the v1 cookies that is causing an unexpected bug (syntax issue maybe?)

If you have a fresh account (no v1 cookies), it seems to work fine.

futuroptimist commented 1 year ago

Looks like this:

image

Unable to reproduce on desktop on prod (democratized.space). Maybe I can debug it on my phone somehow. Looking into that later this weekend.

futuroptimist commented 1 year ago

Going to create a debug page (accessible to everyone because why not) that shows all cookies and localStorage prettyPrinted on a page. Then we can push this to prod and see if it reveals any useful info about why the upgrader isn't working.

futuroptimist commented 1 year ago

I built the /debug page to debug this issue. It allowed me to see all the cookies on my personal device, where I could root cause the issue with trial and error.

It turns out that when I'm parsing for items, anything with an alphanumeric suffix will fail. It's expecting item-${itemCount} and being too greedy, so item-1-cooldown (an old cookie key convention that was used in very early v1) causes an exception (Presumably. That error is getting suppressed).