SaphireLattice / tunic-decoder

A dictionary, text recording and glyph decoder/translation tool for TUNIC game's writing
https://lunar.exchange/tunic-decoder/
8 stars 2 forks source link

Lost all texts after deleting word #10

Closed cappy1310 closed 1 month ago

cappy1310 commented 3 months ago

I've been using this site recently and it's been great! I was doing a decent job of decoding the language as I made my way through the game.

During my decoding efforts, I made an error when trying to record the word "Connection" in the Text - I accidentally separated the word into "Con" and "Nection" words and included them in a text. To try to fix it, I edited "Nection" to be "Connection" and then later I selected the "Con" glyph on the text and tried to delete it from the word list.

When I deleted the word, though, the word didn't disappear from the text. I reloaded the page thinking that would fix it, but none of the texts reappeared. An additional reload confirmed my fears - all the words have 0 uses now, so all the texts I had are gone.

To reproduce:

  1. Add a new word (word 1)
  2. Add a different new word (word 2)
  3. Add word 1 to a text (right-arrow button on word 1)
  4. Add word 2 to the same text
  5. Left-click word 1 in the text or word list to select it
  6. Delete word 1 using the button at the bottom of the Word list
  7. Reload the page
  8. Original text (and any others) are gone

Expected result: Page loads normally with the word removed from the text

Actual result: All texts are deleted; page displays both "Press 'New Text' to add a text" and then "No texts with selected word found. Reset selected word?". Clicking "Reset selected word?" doesn't do anything.

Clicking "New text" doesn't do anything except generate the below javascript error in the console:

vendor.06d451f3.js:1 TypeError: Cannot read properties of undefined (reading 'words') at w (index.3fdfe74f.js:1:21805) at Re (vendor.06d451f3.js:1:12053) at ce (vendor.06d451f3.js:1:12131) at HTMLButtonElement.n (vendor.06d451f3.js:1:51295) Ci @ vendor.06d451f3.js:1

Workaround: Left-clicking the right-arrow button on a word adds that word to a new text and makes the site useable again, but all the texts are still gone...

It's also pretty easy to avoid this bug once you know about it - just remove the word from all texts before deleting it.

Details: Browsers: up-to-date Chrome & Edge

SaphireLattice commented 3 months ago

Thanks a lot for the detailed reproduction! Sorry about this, I've had it reported before but never got around to looking into it. Will try to fix it up some time next week perhaps ^^"

SaphireLattice commented 1 month ago

Thank you for the reproduction, helped me a lot. Fixed via 0f13ee3!