mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2802] [Issue]: Extension (and Mari workspace) import silently swallows failures — surface the real error/toast (privileged-gate 403 et al. are invisible to users) #1425
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#1425
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 22, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2802
Originally assigned to: @kolacheee on GitHub.
Summary
When an extension import fails, the error is swallowed to
console.warnonly and the user sees, at most, a generic "Failed to install 1 extension" toast with no reason — even though the client already holds the server's exact error message. The same silent-failure pattern exists on Professor Mari's workspace import/mutation handlers. The single most common real cause is the privileged-access gate returning 403 (e.g. accessing the app over a non-loopback address without anADMIN_SECRET), but nothing in the UI says so, so users cannot self-diagnose.This is an observability / UX bug. The 403 itself is intended security (extension install is a JS-injection route) — this issue is purely about making the failure visible and actionable, not about removing the gate.
Symptom & UX impact
[ExtensionsSettings] Failed to import extension entry), which most users never open.Root cause (file:line)
1. Extension import swallows the real error.
importExtensionEntriescatches each failed install and onlyconsole.warns it, then shows a count-only toast:The caught
erris anApiErrorthat already carries the server's message:ApiErroris defined atpackages/client/src/lib/api-client.ts:17and thrown forapi.postat:123-124asnew ApiError(res.status, body.error ?? res.statusText, body). Soerr.message/err.statusare available — they are simply never shown.2. Silently-skipped entries.
normalizeExtensionImportEntryreturningnulliscontinued with no count or message (SettingsPanel.tsx:3877), so a file with no importable entry can produce no feedback unless every entry is null.3. Mari workspace path shares the pattern.
HomeProfessorMariChat.tsxhas multiple workspace load/refresh/mutation handlers that swallow errors toconsole.erroronly or.catch(() => undefined)(e.g.:1608,:1633,:1640,:1644,:1650,:1810), so Mari-driven workspace imports/changes can fail with no user-facing toast — matching the "mari package import things just silently fail" half of the report.(For context, the 403 originates from
requirePrivilegedAccessinpackages/server/src/middleware/privileged-gate.ts, applied toPOST/PATCH/DELETE /extensionsinextensions.routes.ts:24/30/41.)Suggested fix
importExtensionEntries, include the real message in the toast, e.g.: (Aggregate per-entry messages, or surface the first, so the count-only warning is replaced/supplemented by the cause.)err instanceof ApiError && err.status === 403, show something like: "Installing extensions requires loopback access or an admin secret. Open the app via localhost, or setADMIN_SECRETon the server and enter it in Settings." This converts the dead-end into a fixable prompt.normalized === null. Count it and tell the user the file contained no importable extension entry.HomeProfessorMariChat.tsxfor the same swallow (.catch(() => undefined)/console.error-only) and surface a toast on failure of a user-initiated action.Affected files
packages/client/src/components/panels/SettingsPanel.tsx—importExtensionEntries(3868-3899),handleImportExtension(3901-3956)packages/client/src/lib/api-client.ts—ApiError(17),api.posterror path (123-124)packages/client/src/components/chat/HomeProfessorMariChat.tsx— workspace import/mutation error handlingpackages/server/src/middleware/privileged-gate.ts/packages/server/src/routes/extensions.routes.ts— context (the 403 whose message should be shown)AI-investigated against released 2.0.0 (
main); verify before fixing. Scope is error visibility only — the privileged-access 403 is intended behavior, separately surfaced to the affected user as a config step.@SpicyMarinara commented on GitHub (Jun 22, 2026):
Addressed in PR #2790 / commit acab1fba: extension imports now surface the real first failure, including actionable privileged-access 403 guidance, invalid extension entries are counted, and Professor Mari workspace/status mutations now show screenshot-friendly failure toasts instead of console-only failures.
@kolacheee commented on GitHub (Jun 22, 2026):
Implementing this (@kolacheee, already assigned). Draft PR opened against
staging: #2803 — surfaces the real error/toast for extension imports (with an actionable admin-secret hint on the privileged-gate 403), counts silently-skipped entries, and adds failure toasts to Professor Mari's workspace approve/reject (theirvoidcall sites were swallowing rejections). (Note: PR targetsstaging, so GitHub won't auto-close this on merge — please close manually when #2803 lands.)