Skip to content

feat(inbox): bulk-remove yourself as a suggested reviewer - #3894

Merged
trunk-io[bot] merged 2 commits into
mainfrom
posthog-code/inbox-bulk-remove-reviewer
Jul 28, 2026
Merged

feat(inbox): bulk-remove yourself as a suggested reviewer#3894
trunk-io[bot] merged 2 commits into
mainfrom
posthog-code/inbox-bulk-remove-reviewer

Conversation

@rafaeelaudibert

Copy link
Copy Markdown
Member

Problem

When triaging the Self-driving inbox, you can already bulk-snooze, suppress, reingest, and delete selected reports — but there was no way to bulk-remove yourself as a suggested reviewer. If you were suggested on a batch of reports that aren't yours, the only option was to open each one and remove yourself from its Reviewers section.

Changes

Adds a "Remove me as reviewer" action to the inbox bulk-selection toolbar.

  • Reuses the existing per-item bulk fan-out (Promise.allSettled, partial-failure tolerant): per selected report it fetches the latest suggested_reviewers artefact, drops the current user's entry, and writes the remaining list back (the artefact PUT replaces the whole list).
  • Eligibility uses the server-annotated is_suggested_reviewer flag, so the button disables (with a reason) when no selected report lists you as a reviewer — and only reports that actually list you get an API call.
  • Fires one INBOX_REPORT_ACTION (remove_suggested_reviewer) per succeeded report, and reconciles the selection like the other bulk actions.

How did you test this?

  • pnpm --filter @posthog/ui typecheck and pnpm --filter @posthog/core typecheck — pass.
  • pnpm --filter @posthog/core test engagement — pass (added a case covering the new remove_suggested_reviewer bulk action type).
  • biome check on the changed files — clean.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Adds a "Remove me as reviewer" action to the inbox bulk-selection toolbar so
you can drop yourself as a suggested reviewer across many reports at once,
instead of opening each report and removing yourself one at a time.

The action reuses the existing per-item bulk fan-out (Promise.allSettled with
partial-failure tolerance): per selected report it fetches the latest
suggested_reviewers artefact, filters out the current user's entry, and writes
the remaining list back. Eligibility is driven by the server-annotated
is_suggested_reviewer flag so the button disables when no selected report lists
you. Fires one INBOX_REPORT_ACTION (remove_suggested_reviewer) per succeeded
report.

Generated-By: PostHog Code
Task-Id: 869023f3-9853-4f11-a433-6ea896c1c32f
@trunk-io

trunk-io Bot commented Jul 28, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@rafaeelaudibert
rafaeelaudibert requested a review from a team July 28, 2026 18:12
@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit aa9d7bc.

Comment thread packages/ui/src/features/inbox/hooks/useInboxBulkActions.ts Outdated
Comment thread packages/ui/src/features/inbox/hooks/useInboxBulkActions.ts
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
### Issue 1
packages/ui/src/features/inbox/hooks/useInboxBulkActions.ts:443-444
**No-op removals count as success**

When the artefact is absent or contains no matching UUID, this callback resolves without updating anything, so `runBulkAction` records the report as succeeded and the UI emits success analytics, shows a success toast, and removes it from the selection even though the reviewer remains.

### Issue 2
packages/ui/src/features/inbox/hooks/useInboxBulkActions.ts:449-453
**Replacement writes lose concurrent updates**

When another reviewer edit completes between this action's artefact GET and PUT, this full-list replacement writes the stale snapshot without any version guard, causing the concurrent reviewer addition or removal to be overwritten.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "feat(inbox): bulk-remove yourself as a s..." | Re-trigger Greptile

@rafaeelaudibert
rafaeelaudibert requested a review from a team July 28, 2026 19:16
Addresses Greptile review feedback: when a selected report's suggested_reviewers
artefact is missing or doesn't list the current user, the per-item callback
resolved silently, so runBulkAction recorded it as a success — firing a success
toast/analytics and dropping the report from the selection while the reviewer
was never removed. Throw in both cases so the report is counted as a failure and
stays selected for retry.

Generated-By: PostHog Code
Task-Id: 869023f3-9853-4f11-a433-6ea896c1c32f

Copy link
Copy Markdown
Member Author

/trunk merge

@trunk-io
trunk-io Bot merged commit bad3a5b into main Jul 28, 2026
33 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/inbox-bulk-remove-reviewer branch July 28, 2026 20:18
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.

2 participants