Skip to content

fix(invitations): report every reason a batch of invites failed - #6093

Open
icecrasher321 wants to merge 1 commit into
stagingfrom
fix/invite-batch-error-message
Open

fix(invitations): report every reason a batch of invites failed#6093
icecrasher321 wants to merge 1 commit into
stagingfrom
fix/invite-batch-error-message

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

The invite modal collapsed a multi-failure batch to N invitations failed. plus the first reason and discarded the rest. The batch endpoint rejects per email and each reason names its own address, so inviting several people who are all ineligible for the chosen membership — the common multi-failure case, since External requires every invitee to already be on a paid plan — named one of them and hid the others. The failed addresses are reseeded into the field as ordinary chips carrying no error state, so nothing else on screen identified them either.

buildInviteFailureMessage now lists the distinct reasons, collapses identical ones, and reports the denominator ("2 of 5 invitations could not be sent") the way add-people-modal already did for the same partial -failure shape. Past three reasons the tail is counted rather than listed, so a large batch cannot bury the modal in near-identical sentences.

Type of Change

  • Documentation

Testing

N/A

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

The invite modal collapsed a multi-failure batch to `N invitations
failed.` plus the first reason and discarded the rest. The batch endpoint
rejects per email and each reason names its own address, so inviting
several people who are all ineligible for the chosen membership — the
common multi-failure case, since External requires every invitee to
already be on a paid plan — named one of them and hid the others. The
failed addresses are reseeded into the field as ordinary chips carrying
no error state, so nothing else on screen identified them either.

`buildInviteFailureMessage` now lists the distinct reasons, collapses
identical ones, and reports the denominator ("2 of 5 invitations could
not be sent") the way add-people-modal already did for the same partial
-failure shape. Past three reasons the tail is counted rather than
listed, so a large batch cannot bury the modal in near-identical
sentences.

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 30, 2026 6:51am

Request Review

@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
UI-only error messaging in the invite modal with no API or auth changes; behavior is covered by new unit tests.

Overview
Batch invite failures in the invite modal no longer collapse to only the first per-email error. A new exported buildInviteFailureMessage drives the submit error when some or all invitations fail.

For a single failure it still shows that reason alone. For multiple failures it adds a headline (none sent vs N of M could not be sent), lists up to three distinct reasons (deduped), and appends "And X more." when there are additional unique reasons so large batches stay readable. The modal wires this in via setErrorMessage(buildInviteFailureMessage(...)) while still reseeding failed addresses for retry.

Unit tests cover single failure, full-batch rejection, partial batch, deduplication, and the capped list tail.

Reviewed by Cursor Bugbot for commit 13ee6a9. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Improves invite-modal batch failure copy so multi-invite failures list distinct server reasons (with a cap) instead of only the first reason.

  • Adds exported buildInviteFailureMessage that headlines partial vs total failure, dedupes identical reasons, lists up to three, then counts the rest.
  • Wires the submit onSuccess path to use that helper with result.failed and emails.length.
  • Adds unit coverage for single, full-batch same-cause, partial mixed, collapsed identical, and truncated multi-reason cases.

Confidence Score: 5/5

Safe to merge; the change is limited to clearer multi-failure error messaging with matching tests.

No behavioral contract beyond UI copy is altered, the helper handles single/partial/full batches and reason truncation as intended, and security surface is unchanged.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/components/invite-modal/invite-modal.tsx Pure presentation helper plus call-site swap; attempted count still comes from the submitted emails closure, matching prior batch size semantics.
apps/sim/app/workspace/[workspaceId]/components/invite-modal/invite-modal.test.tsx Focused unit tests exercise the new message builder edge cases without changing modal behavior tests.

Reviews (1): Last reviewed commit: "fix(invitations): report every reason a ..." | Re-trigger Greptile

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