Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script executing too early since MBS React changes #484

Closed
ROpdebee opened this issue Jun 13, 2022 · 0 comments · Fixed by #489
Closed

Script executing too early since MBS React changes #484

ROpdebee opened this issue Jun 13, 2022 · 0 comments · Fixed by #489
Assignees
Labels

Comments

@ROpdebee
Copy link
Owner

ROpdebee commented Jun 13, 2022

https://community.metabrainz.org/t/ropdebees-userscripts-support-thread/551947/77?u=ropdebee

This one doesn’t reliably work for me. Even for the same release.

There is nothing in the console and API request goes through just fine. It was the only script enabled. Although when I enable some more it sometimes works. Apparently INLINE STUFF makes it work.

E.g. with this config it doesn’t work for me. But as soon as I enable INLINE STUFF it magically works.

Display CAA image dimensions
REVIVE DELETED EDITORS
MASS MERGE RECORDINGS
MERGE HELPOR 2
Compare AcoustIDs easier! (enableMiniIcons = false)
MASS ISRC
Change release quality
Mark recordings as video
Lean display
Seed the batch recording comments script
Inline all recording's tracks on releases
Set recording comments for a release

Once I also enable Blind Votes and Supercharged Cover Art Edits it stops working again. Plus I finally see an error:

instrument.js:102 Loading “Thrivemix Presents: Electro” shadow release…
instrument.js:102 Loading AcoustIDs…
helpers.js:88 Uncaught TypeError: recAnchors is not iterable
    at HTMLButtonElement.loadAndInsert (MB: QoL: Inline all recording's tracks on releases.user.js:95:20)
    at HTMLButtonElement.dispatch (MB: Supercharged Cover Art Edits.user.js:4435:9)
    at HTMLButtonElement.elemData.handle (MB: Supercharged Cover Art Edits.user.js:4121:28)
    at HTMLButtonElement.r (helpers.js:71:23)
helpers.js:88 Uncaught TypeError: recAnchors is not iterable
    at HTMLButtonElement.loadAndInsert (MB: QoL: Inline all recording's tracks on releases.user.js:95:20)
    at HTMLButtonElement.dispatch (MB: Supercharged Cover Art Edits.user.js:4435:9)
    at HTMLButtonElement.elemData.handle (MB: Supercharged Cover Art Edits.user.js:4121:28)
    at HTMLButtonElement.r (helpers.js:71:23)
DevTools failed to load source map: Could not load content for chrome-extension://o

jesus2099 response

I think it may be because doing that, you are delaying @ROpdebee script a little bit more, just enough time to make it run on a stabilised tracklist.

Since a recent change on the MB release tracklist display with React, the tracklist is not stable as soon as the page is loaded and many userscripts will work only if they are delayed.

It’s just a work-around until the scripts do actually support this server change properly.

It'd be weird if it had something to do with waiting for the tracklist to load, because this script should only do its job once a button is clicked… I'm more inclined to say it's accidentally relying on something that's inserted by INLINE STUFF in one of the DOM queries. Nope, it's indeed loading before the page is ready. It doesn't even insert the button since the elements to which it wants to attach aren't present. It does insert the button, which causes a hydration error, making React fall back to client-side rendering, thus re-rendering the component and throwing out the button again.

As for why Blind Votes and Supercharged are causing issues……jQuery again? Maybe conflicting versions of jQuery?

@ROpdebee ROpdebee added bug Something isn't working mb_qol_inline_recording_tracks labels Jun 13, 2022
@ROpdebee ROpdebee self-assigned this Jun 13, 2022
@ROpdebee ROpdebee changed the title Conflicts with/dependencies on other scripts in inline tracks for recordings Script executing too early since MBS React changes Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant