mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2952] [Issue]: A throwing extension timer/event handler logs an anonymous blob: error instead of naming the extension #1531
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1531
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Jun 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2952
Originally assigned to: @SpicyMarinara on GitHub.
What's wrong
The helper APIs extensions use to register callbacks —
marinara.on,marinara.setInterval,marinara.setTimeout,marinara.observe— pass the extension's callback straight to the browser with no error wrapper. So if an extension's interval or event handler throws, you get an anonymous uncaught error attributed only to ablob:URL, with no hint as to which extension is responsible. The file already wraps extension cleanup functions exactly this way (logging[Extension:<name>]); the handler paths just don't.How to reproduce (try it yourself)
You'll see: an uncaught
Error: boomevery 500ms, attributed only to ablob:URL — no extension name, no way to tell which extension is the culprit.Expected: the error is caught and logged as
[Extension:<name>] …so a user can tell which extension is misbehaving. (The interval correctly keeps firing until the extension is disabled — that part is fine; only the attribution is the issue.)Where it is
packages/client/src/components/layout/CustomThemeInjector.tsx— the auto-cleanup handlers at lines 205-232 (on,setInterval,setTimeout,observe) pass user callbacks unwrapped toaddEventListener/window.setInterval/window.setTimeout/new MutationObserver. The precedent to copy isrunExtensionCleanupsat lines 123-128, which already try/catches and logs[Extension:${ext.name}]. Error handling currently exists only around the synchronous module import (.catchat 252-258); async handlers registered later run unwrapped.What's happening
Callbacks registered via the auto-cleanup API run after the module import, outside any try/catch, so a throw is unattributed.
Suggested fix
Wrap the callbacks registered via
on/setInterval/setTimeout/observein a try/catch thatconsole.errors[Extension:${ext.name}], matching line 126. Keep logging the error (don't swallow it) — the uncaught error is currently the only signal a user gets that their extension is broken.AI-investigated against v2.0.6; cited lines read. Please confirm before fixing.
@SpicyMarinara commented on GitHub (Jun 28, 2026):
Fixed on staging: extension event, timer, timeout, and mutation callbacks are wrapped with named
[Extension:<name>]error logging.