Skip to content

People section: report mutation failures via reportError - #444

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-7139-settings-people-section-mutation-catches-discard-the-cause
Aug 29, 2026
Merged

TheGreatAxios merged 3 commits into
mainfrom
cl-7139-settings-people-section-mutation-catches-discard-the-cause

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Fixes CL-7139 — https://linear.app/abklabs/issue/CL-7139

Problem

packages/settings-ui/src/people-section.tsx's mutation catches (invite,
cancel-invite, suspend/reactivate, remove, role-change — originally around
lines 174, 183, 194, 202, 235) all did .catch(() => setXError(GENERIC)),
discarding the cause entirely. No reportError call anywhere in
packages/settings-ui/src — a failed mutation left nothing for support to
trace back to.

Change

  • Every mutation catch now calls reportError(cause, { operation: "settings.people.<action>", tenantId }) before setting the existing
    user-facing message (copy unchanged):
    • settings.people.invite
    • settings.people.cancelInvite
    • settings.people.updateStatus (suspend/reactivate)
    • settings.people.remove
    • settings.people.changeRole
  • Added @corbits/error-sink (workspace:*) to packages/settings-ui/package.json.

Tests

Added a red/green case in packages/settings-ui/test/people-section.test.tsx:
mocks @corbits/error-sink via mock.module, forces the suspend mutation's
fetch to fail, and asserts reportError was called with
operation: "settings.people.updateStatus" and tenantId: "tnt_1". Verified
it fails without the fix and passes with it.

The other settings sections (bench, chats & channels, account) have the same
gap — left for a follow-up ticket, not filed here.

A failing suspend mutation should call reportError with the action's
operation and tenant id, not just set the generic message. Covers this
before people-section.tsx wires reportError in.
Invite, cancel-invite, suspend/reactivate, remove, and role-change
catches silently discarded the cause and never gave support a refId
to trace. Route each through reportError with its operation and
tenant id before setting the existing user-facing message.

Fixes CL-7139.
The prior test only covered the suspend catch. Parametrize it over
invite, cancel-invite, remove, and role-change too, each asserting its
own settings.people.<action> operation.
@TheGreatAxios
TheGreatAxios force-pushed the cl-7139-settings-people-section-mutation-catches-discard-the-cause branch from d1e172c to f215a6b Compare August 29, 2026 04:58
@TheGreatAxios
TheGreatAxios merged commit 0813e61 into main Aug 29, 2026
5 checks passed
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