jesus2099 / konami-command

power‐ups for various web sites
120 stars 25 forks source link

Dynamic loader fails when optional entities are not checked #665

Closed ToadKing closed 2 years ago

ToadKing commented 2 years ago

COLLECTION HIGHLIGHTER: Exception when trying to add a release

Trying to add this release logs this error in my console:

Uncaught TypeError: can't access property "indexOf", stuff[type].rawids is undefined
    addRemoveEntities mb. COLLECTION HIGHLIGHTER.user.js:628
    browseReleases mb. COLLECTION HIGHLIGHTER.user.js:535
    loadReleases mb. COLLECTION HIGHLIGHTER.user.js:479
    r helpers.js:71
    _wrapEventTarget trycatch.js:74
    ce instrument.js:328
    loadReleases mb. COLLECTION HIGHLIGHTER.user.js:473
    collectionUpdater mb. COLLECTION HIGHLIGHTER.user.js:725
    r helpers.js:71
    _wrapEventTarget trycatch.js:74
    ce instrument.js:328
    collectionUpdater mb. COLLECTION HIGHLIGHTER.user.js:712
    VMin028ifn5j1 mb. COLLECTION HIGHLIGHTER.user.js:220
    VMin028ifn5j1 mb. COLLECTION HIGHLIGHTER.user.js:1145
    VMin028ifn5j1 mb. COLLECTION HIGHLIGHTER.user.js:1145
    a injected-web.js:1
    v injected-web.js:1
    set injected-web.js:1
    <anonymous> mb. COLLECTION HIGHLIGHTER.user.js:1
    c injected-web.js:1
    ScriptData injected-web.js:1
    onHandle injected-web.js:1
    c injected-web.js:1

(Due to how Violentmonkey works, subtract 138 from the script line numbers to get the actual number)

Script version: 2022.1.23 Userscript manager: Violentmonkey Browser: Firefox Nightly 98.0a1 (2022-01-26) (64-bit)

jesus2099 commented 2 years ago

Linux Debian 10 Firefox 91.5.0esr (64 bits) Violentmonkey 2.12.10 mb. COLLECTION HIGHLIGHTER version 2022.1.23

I tried ON and OFF links, OK. Then I tried Add to collection then Remove from collection, they worked too, with no errors.

ToadKing commented 2 years ago

It looks like it might be something with my collection stuff that's corrupted. stuff.label is this for me:

{ rawids: undefined, loaded: true, ids: null }

Let me try refreshing my collection and trying again.

EDIT: Refreshed my collection and it still isn't working.

jesus2099 commented 2 years ago

On your collections page, near the (Re)Load link, did you check to load labels or not? If you open the script code with Violentmonkey, there is a Values tab, between Configuration and Require. Does the content of labels, releases, etc. look correct, in there?

ToadKing commented 2 years ago

That might be it. I have the "Labels" option unchecked and there's no labels field in the values tab.

image

jesus2099 commented 2 years ago

Windows 10 Vivaldi 5.0.2497.48 (Stable channel) (64 bits) Violentmonkey 2.13.0 mb. COLLECTION HIGHLIGHTER 2022.1.23

I tried ON and OFF links, OK. Then I tried Add to collection then Remove from collection, they worked too, with no errors.

jesus2099 commented 2 years ago

Actually, I usually don't highlight labels either. But for this new version, I thought I should turn them ON to check if it works. I didn't try the script again when turning them back OFF, apparently! Thanks very much for the report, @ToadKing! 😃👍

ToadKing commented 2 years ago

Not sure if this warrants another bug being opened, but the fix seems to have broken something else and I can't seem to add any releases to the highlighter now. I uninstalled/reinstalled the script and tried to reload my collection but nothing loaded. The values tab in Violentmonkey only has the collections values and the "cfg" values

jesus2099 commented 2 years ago

Thank you, I will test.

jesus2099 commented 2 years ago

If you have this bug:

As a work-around, please enable (check) all entity types in the settings, and reload your collection.

ToadKing commented 2 years ago

I tried that and it still doesn't seem to work.

Values looks like this:

image

Script version 2022.1.27

jesus2099 commented 2 years ago

@ToadKing, I have forced all entity highlights and it works now, as a temporary work-around. Sorry, when I said it worked with all entities checked, it's because I already had that modified version locally, I forgot I did not push it to public.

I keep this ticket open. I will first reorganise my loadReleases code to make it external and used by MASS MERGE as well. Then I will work on re-enabling the settings.

jesus2099 commented 2 years ago

Hi @ToadKing, I think this time, I fixed this bug, for real. Please tell me again. 😅

ToadKing commented 2 years ago

@jesus2099 Did a reload with the new version and it seems to work with the "Labels" box unchecked. Thanks!