Repository navigation
Add retry button for failed /recent outreach - #62
Merged
Merged
Conversation
Failed (and timed-out) rows in the "Send outreach" history on /recent had no way to re-attempt delivery — which stung most on the Chromium-based social platforms, where a bulk "post to all" run fails several at once due to parallel browser-launch resource exhaustion. Adds a Retry button on each failed/timed-out history row plus a retryRecentOutreach server action. The action reconstructs the original request from the stored recent_outreach_messages row (channel, subject, body, visibility, audit, org) and runs it back through sendRecentAuditOutreach, so credit charging, history recording, and failure refunds all behave exactly like a first attempt. Social rows only record the platform, so it resolves the user's active account(s) on that platform to retry against. Retrying one row at a time also sidesteps the parallel-launch crash that bulk sends hit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Failed (and timed-out) rows in the Send outreach history on
/recenthad no way to re-attempt delivery. This adds a Retry button to each such row.This is the surface behind the delivery log you'd see after a "post to all" run — e.g. Bluesky/Discord/Telegram sent, while X/Threads/Instagram/Facebook/LinkedIn/Mastodon failed with the Chromium launch crash (
pthread_create: Resource temporarily unavailable— parallel headless-browser launches exhausting the thread limit), and Reddit failed on a missing subreddit.How
retryRecentOutreach({ messageId })server action — reads the storedrecent_outreach_messagesrow, verifies org ownership, guards onfailed/timed_out, and reconstructs the original request (channel, subject, body, visibility, audit, org) to run back through the existingsendRecentAuditOutreach. That means credit charging, fresh history recording, and failure refunds all behave exactly like a first attempt — the old row is left intact as an audit trail.RetryOutreachButtoninoutreach-form.tsx— mirrors the existingRetryPostButtonpattern (transition +router.refresh()), shown on failed/timed-out history rows.Bonus: retrying one row at a time naturally avoids the parallel browser-launch storm that makes bulk sends fail on the browser-driven platforms — a practical mitigation until browser concurrency is capped.
Verification
tsc --noEmitcleantests/sp/*pass (20/20)retryPost→RetryPostButtonflow; the delegatedsendRecentAuditOutreachcredit/record/refund path is unchanged. A live end-to-end run wasn't exercised here (needs seeded auth + org + a failed message + a connected social account).Not included
The root-cause fix for the bulk failures — capping concurrency of the browser-based posters (a semaphore so only 1–2 headless Chromium launch at once) — is a separate change; happy to follow up if wanted.
🤖 Generated with Claude Code