deathandmayhem / jolly-roger

Dead men tell no tales!
MIT License
18 stars 5 forks source link

Pressing browser back after opening a puzzle causes an error about a deleted sheet #2162

Closed jpd236 closed 1 week ago

jpd236 commented 1 month ago
  1. Open a puzzle page
  2. Hit browser back

Expected: Goes back to puzzle list

Actual: Notification shows up in the sheet:

"Cannot open the link because the linked sheet is deleted."

Hitting back again goes back to the list as expected.

jpd236 commented 8 hours ago

Hm, this fixed the issue locally, but I just pushed it out and it doesn't seem to have done the trick in our production instance. In production, both of the "gid=0" instances in the URL are replaced with an actual GID number, which seems to cause the same problem. Maybe it's because we have a multi-sheet template in production, whereas locally I was testing without a template.

zarvox commented 7 hours ago

Interesting. I observe that for our production multi-sheet template, the sheet which was the original sheet in the document is still gid=0, whereas the other tabs have nonzero gid= values. I also observe that all of the clones of this template have their initial tabs sharing the same gid= values (i.e. first tab is always gid=0, second tab is always gid=1447632617).

When your production template was created, did you by chance add new sheets and remove the original sheet of the document, causing sheet id 0 to cease to exist in the template?

jpd236 commented 5 hours ago

Thanks, yeah, that's exactly it. Our template's first sheet used to be for signing into puzzles manually so we could keep track of who was working on what. We deleted it now that Jolly Roger can do that automatically.

I recreated a new template file and imported the existing sheets into it so now the intended default sheet has gid=0, so we should be fine here.