sindresorhus/refined-github

`onPrMergePanelOpen()` may be broken #3932

cheap-glitch posted onGitHub

<!-- Thanks for reporting a bug! â›° 1. Make sure the bug is caused by Refined GitHub. Try disabling the extension first. 2. Include a full URL where the bug appears. 3. Include a screenshot/gif Issues without a URL/screenshot will be closed -->

  1. Go to a PR page (e.g. https://github.com/sindresorhus/refined-github/pull/3886)
  2. Type something in the comment form at the bottom
  3. Reload the page

Two features will produce an error (sometimes only one of them appear):

clear-pr-merge-commit-message → TypeError: messageField is undefined
suggest-commit-title-limit → TypeError: inputField is undefined

Since both of these features make use of onPrMergePanelOpen, I'm guessing that's where the problem is.


I think they’re both referring to the textarea or input, likely their selector needs to be updated

posted by fregante about 4 years ago

I think they’re both referring to the textarea or input, likely their selector needs to be updated

I may be wrong, but I think it's more a case of the features being triggered when they shouldn't be.

posted by cheap-glitch about 4 years ago

Can't replicate the error in any way, the 2 fields exist on the page from the very beginning, regardless of the field opening. That listener awaits domReady as well.

Maybe this only happens when the listener is called while the mergeability box is updated (for example after a push, rather than after a comment/refresh)

Edit: I tried that too, nothing 🤔

posted by fregante about 4 years ago

I still see the errors on latest main commit. @fregante did you type something in the comment box? The errors only appear for me if some text is already present in the comment textarea when the page loads.

posted by cheap-glitch about 4 years ago
posted by yakov116 about 4 years ago

Wow, it feels like I left that review yesterday, but it’s been nearly a year

posted by fregante about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests