themoeway / yomitan

Japanese pop-up dictionary browser extension. Successor to Yomichan.
https://chromewebstore.google.com/detail/yomitan/likgccmbimhjbgkjambclfkhldnlhbnn
GNU General Public License v3.0
989 stars 76 forks source link

Dictionary importing occasionally ends with error #723

Closed Kuuuube closed 2 months ago

Kuuuube commented 5 months ago

Description Seemingly randomly when importing a dict right as it finishes importing, the following error appears: Error: Unexpected response of type undefined ({"action":"optionsGetFull"})

It seems to import the dictionary correctly and upon a reload of the page, everything is fine and back to normal with the new dict imported although not enabled by default like normal.

Importing another dict after the error also makes it refresh and find the dict that errored.

Browser version Firefox 124.0b2 (64-bit)

Yomitan version Yomitan 24.2.12.0

donkuri commented 5 months ago

Also happens on my end with Firefox Nightly 116.0a1 (64-bit) with Yomitan version 23.12.29.0.

Kuuuube commented 4 months ago

This seems to happen much more consistently on a slower device when importing large dicts such as jmdict (small ones i havent had fail at all). Possibly a race condition somewhere? I've tried looking around and I don't see any red flags popping out myself.

Also all reports of this happening so far are only on firefox.

@toasted-nutbread since you did a lot of the refactoring around this.

donkuri commented 4 months ago

This seems to happen much more consistently on a slower device when importing large dicts such as jmdict (small ones i havent had fail at all). Possibly a race condition somewhere? I've tried looking around and I don't see any red flags popping out myself.

For what it's worth, I get this every single time I have imported my dictionaries collection on Firefox (Nightly), and I have a laptop with a Ryzen 5 5600H and 16gigs of RAM.

Kuuuube commented 3 months ago

Further testing, this bug seems to have been added between 23.11.23.0 and 23.12.29.0. https://github.com/themoeway/yomitan/compare/23.11.23.0...23.12.29.0

Kuuuube commented 2 months ago

Turns out this bug has been reported as far back as 2023-12-09 on 23.11.23.0 (first stable release). Considering this bug only happens on firefox as well I think it's safe to assume this is due to an inconsistency in firefox's implementation of manifest v3. This may be impossible to entirely fix.

However, given that this bug seems to be mostly visual it might be possible to ignore and simply continue the dict import as a workaround.