Skip to content

Bug: raw ConvexError .message leaks in save-error toasts across ~7 governance editors — survivors of the #2062 sweep #2669

Closed

Description

@yannickmonney

Problem

The #2062 fix routed governance save failures through mapGovernanceSaveError so users see a localized message instead of the dev-facing [CONVEX A(...)] {"code":…} stacktrace string. Several editors were missed and still surface error.message raw (a divergent second copy of the pattern the helper's own docstring warns against). Three also hardcode English fallbacks ("Failed to save" / "Restore failed"), and one falls back to an empty toast description.

Current behaviour

Code-grounded (2026-07-11, main @ 94ef84e) — sites that surface error.message raw instead of mapGovernanceSaveError:

  • feature-flags-editor.tsx:373
  • model-access-editor.tsx:446
  • default-model-editor.tsx:463 (also hardcoded English "Failed to save")
  • voice-output-policy-editor.tsx:70 (falls back to description: undefined → empty toast)
  • retention-edit-drawer.tsx:170 (also hardcoded English)
  • retention-bounds-proposal-banner.tsx:82,102
  • retention-pending-banner.tsx:88
  • trash-page.tsx:188 (hardcoded English "Restore failed")

Correct reference pattern: budget-editor.tsx:584 (mapGovernanceSaveError); rationale in governance-save-errors.ts:5-17.

Live example: #2660's feature-flags sub-4096 save throws a validation ConvexError whose raw message would render here.

Proposed change

Route every governance save/restore error through mapGovernanceSaveError; remove the hardcoded English fallbacks (use the localized default).

Acceptance criteria

  • All listed editors surface a localized, non-stacktrace message on save failure
  • No hardcoded English "Failed to save" / "Restore failed"; no empty-description toasts
  • A lint/test guards against reintroducing raw error.message in these toasts

Follows #2062 (closed) — these are the survivors.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: mediumservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions