Skip to content

Silence double error toasts in the apps/GitHub/misc client sites (#2669)#2721

Merged
atomantic merged 2 commits into
mainfrom
claim/issue-2669
Jul 17, 2026
Merged

Silence double error toasts in the apps/GitHub/misc client sites (#2669)#2721
atomantic merged 2 commits into
mainfrom
claim/issue-2669

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

Sweeps the Apps / GitHub / misc pages batch of #2669: 28 call sites where a caller shows its own toast.error in a rejection handler and the API call routes through the auto-toasting request() helper, so the user sees two stacked toasts. Each now passes { silent: true } per the "Custom catch ⇒ silent: true" rule in CLAUDE.md, leaving exactly one toast layer.

Threaded a backward-compatible trailing options param into the wrappers that lacked one: apiGit.js (deleteBranch, mergeBranch, checkoutRemoteBranch, cleanupMergedBranches), apiGithub.js (all repo + secret calls), apiReferenceRepos.js (all five), apiApps.js (buildApp), and apiAsk.js (promoteAskTurn, deleteAskConversation). apiAuthors.js and navigateBrowser already had one.

Record correction: the issue's original "Remaining" list was stale — PR #2682 was a broad sweep that already covered writers-room, universe/universeBuilder, digital-twin, media pages, and the shared hooks. The ## Remaining section below reflects a fresh wrapper-aware scan, not those stale bullets.

Sites swept (28): Tribe 6, ReferenceReposPanel 5, GitHub 5, GitTab 4, Authors 4, Ask 2, AppDetailView 1, Browser 1.

Deliberately not touched (verified single-layer, not misses)

A naive .catch + toast.error grep produces false positives here; these were classified and correctly left alone:

  • GitTab.handleSync / handlePushAll — use .catch(() => null) with no toast in the catch. Their toast.error fires on a successful response's per-branch error payload, not on a thrown error. Adding silent would suppress the only toast a transport failure gets.
  • fixAppViteHosts (AppDetailView) — wrapper is already silent-by-default (hardcoded silent: true).
  • Ask.streamAskTurn — raw fetch, never routes through request() (same class as the previously-noted StagePromptModelPicker.jsx:78).
  • Toast-less swallowing catchesgetGitHubSecrets().catch(() => ({})), getTribeMemoryLinks(...).catch(() => ({ links: [] })), getTribeTouchpoints(...), the legacy-contact import — single default layer is correct per the rule.
  • getTribePeople({ silent: true }) — already passes silent.

Also swept explicitly for the bug class an inline-.catch grep misses: useLockToggle / useAsyncAction consumers (none in this batch's scope) and .then(onOk, onErr) rejection handlers — which caught Ask.jsx:439 (deleteAskConversation) and three ReferenceReposPanel sites that a .catch grep would have skipped.

Test plan

  • cd client && npm test400 files / 4319 tests passing.
  • npx eslint on all 14 changed files — clean.
  • Arg-exact wrapper tests (incl. GitTab.test.jsx) still pass: every options param is trailing and defaulted, so existing call sites are unaffected.

Remaining

Per a fresh wrapper-aware scan (classify each api* wrapper as silent-by-default vs toasting, then match custom-catch callers that omit silent). Counts are raw grep hits for areas outside this batch and are not individually wrapper-verified:

  • Creative Director (~3): CreativeDirector.jsx:180, PlanTab.jsx (2 — :91, :103/:113), OverviewTab.jsx:148.
  • Loras / media leftovers (~9): Loras.jsx (6), MediaModels.jsx (4), MediaJobsQueue, ImageGen, ImageClean, MusicVideo.
  • Misc singles (~5): CatalogCastPanel, GmailMboxImportPanel, LocalLlmTab, MessageDetail, GenomeTab, PipelineManuscriptEditor.
  • components/pipeline/ManuscriptCommentCard.jsx:247,251generatePipelineManuscriptFix still needs an options param.

Already shipped and verified clean — do not re-sweep: settings tabs + JIRA (#2670), messages/calendar/sharing, pipeline stages/canvas (#2714), and writers-room / universe / universeBuilder / digital-twin / media pages / shared hooks (#2682).

Refs #2669

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant