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

UnhandledRejection: Non-Error promise rejection captured with keys: [object has no keys] #672

Closed
jesus2099 opened this issue Apr 11, 2022 · 3 comments

Comments

@jesus2099
Copy link
Owner

From @reosarevok
https://chatlogs.metabrainz.org/libera/metabrainz/msg/4986408/

jesus2099: we're seeing a fair amount of unhandled exceptions on our sentry monitoring that seem related to "a.jesus2099PendingEditsToggle"
UnhandledRejection: Non-Error promise rejection captured with keys: [object has no keys]
Either that or dd > a#tog81127AcoustID[title="shift+click to hide/show all"]
Which I expect it's also part of the same script or a similar one?
Anyway, maybe you can take a look at it when you have some time, see if you can figure it out, happy to help if useful

If it's a.jesus2099PendingEditsToggle then it's:

li.insertBefore(createTag("a", {a: {class: SCRIPT_KEY + "Toggle"}, s: {position: "absolute", right: "4px"}, e: {click: function(event) {
var collapse = (this.textContent == expanded);
for (var options = document.querySelectorAll("ul." + SCRIPT_KEY + "EditList, span." + SCRIPT_KEY + "Help"), o = 0; o < options.length; o++) {
options[o].style.setProperty("display", collapse ? "none" : (options[o].tagName == "UL" ? "block" : "inline"));
}
for (var toggles = document.querySelectorAll("a." + SCRIPT_KEY + "Toggle"), t = 0; t < toggles.length; t++) {
replaceChildren(document.createTextNode(collapse ? collapsed : expanded), toggles[t]);
}
localStorage.setItem(SCRIPT_KEY + "PendingEditLists", collapse ? collapsed : expanded);
}}}, expandEditLists ? expanded : collapsed), li.firstChild);

But if it's dd > a#tog81127AcoustID[title="shift+click to hide/show all"] then it's:

var typetoggle = cooldd.appendChild(createA(localStorage.getItem("hide" + type + "81127") == "1" ? "show" : "hide", null, "shift+click to hide/show all"));
typetoggle.style.setProperty("cursor", "pointer");
typetoggle.setAttribute("id", "tog81127" + type);
typetoggle.addEventListener("click", function(event) {
var type = this.getAttribute("id").match(/^tog81127([a-z]+)$/i)[1];
var show = (this.textContent == "show");
localStorage.setItem("hide" + type + "81127", show ? "0" : "1");
var togstuffs = document.getElementsByClassName(type + 81127);
for (var itog = 0; itog < togstuffs.length; itog++) {
togstuffs[itog].style.setProperty("display", show ? "block" : "none");
}
this.replaceChild(document.createTextNode(show ? "hide" : "show"), this.firstChild);
if (event.shiftKey && bonusclicks.length == 0) {
let showHideARSButt = document.querySelector("a." + (show ? "show" : "hide") + "-credits");
if (showHideARSButt) {
showHideARSButt[0].click();
} else {
var ars = document.querySelectorAll("div.ars");
for (var iar = 0; iar < ars.length; iar++) {
ars[iar].style.setProperty("display", show ? "block" : "none");
}
}
let showToolZones = document.querySelectorAll("div#sidebar div#" + userjs + "idcountzone input[type='checkbox']");
if (showToolZones) {
for (var stz = 0; stz < showToolZones.length; stz++) {
if (showToolZones[stz].checked != show) showToolZones[stz].click();
}
}
var otogs = ["AcoustID", "ISRC"];
for (var iotog = 0; iotog < otogs.length; iotog++) {
var togid = "tog81127" + otogs[iotog];
var toglnk = document.getElementById(togid);
if (this.id != togid && toglnk && toglnk.textContent == (show ? "show" : "hide")) {
bonusclicks.push(toglnk);
}
}
}
if (bonusclicks.length > 0) {
bonusclicks.pop().click();
}
}, false); // onclick

Now, erh, Non-Error promise rejection captured? 🤔

@jesus2099
Copy link
Owner Author

Thanks @reosarevok!

I don't think PENDING EDITS has any issues, at the moment.

I don't use any promises, I think, but INLINE STUFF does crash since React hydrate is being used in release page: #596.

@jesus2099
Copy link
Owner Author

jesus2099 commented Apr 11, 2022

@reosarevok, in fact it is not due to any of my scripts nor to any userscripts at all.
If I switch off Violentmonkey and Stylus completely, it still happen twice on this random page, but I guess everywhere, kind of:

Uncaught (in promise) Error: The message port closed before a response was received.

@jesus2099
Copy link
Owner Author

jesus2099 commented Apr 11, 2022

But it seems related to browser.

It happens in:

  • Windows* Vivaldi twice per page:
    Uncaught (in promise) Error: The message port closed before a response was received.
  • Windows* Edge once per page:
    Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.

It does not happen in:

  • Linux Firefox
  • Windows* Chrome
  • Windows* Firefox

* behind company proxy/firewall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant