Recover from a failed or uncertain write
What to read and what to do next after a timeout, a conflict, a paused batch or an uncertain send on the Reddit routes
When a write fails or its answer is lost, read the state before you act again. Each row below names what to read, the safe next step and the step that can do harm. This page covers the Reddit API and the rules every route shares. Other product families aren't covered here yet.
note
Submitting Reddit outreach isn't available yet. Until it opens, POST /reddit/outreach answers 503 outreach_disabled, so the batch rows below apply once it does.
Any Reddit route
| State | Read first | Safe action | Unsafe action |
|---|---|---|---|
503 request_timeout on a write | The resource's own read | Act on what the read shows. The work may have finished, and the call is refunded | Sending the write again before you read |
409 revision_conflict | The resource again, for its current revision | Apply your change to what you just read, then send it with the new revision | Sending the old revision again, which fails the same way, or your old list with the new revision, which can undo a change made since |
429 rate_limited | Nothing | Wait for Retry-After, then retry | Retrying at once |
409 reddit_signals_off, 503 reddit_mentions_disabled or 503 outreach_disabled | Nothing | Wait until the product opens. Gates lists what each closed product answers | Retrying in a loop |
Watched subreddits and saved drafts
| State | Read first | Safe action | Unsafe action |
|---|---|---|---|
A watch change on PUT /reddit/subreddits failed or timed out | GET /reddit/subreddits | Compare subreddits and x_topics with what you sent. If a list doesn't match, send that whole list again with the revision you just read. A list you send replaces the watched one, and a list you leave out stays as it is. S'more saves X topics before the rest, so after a failure the topics can be saved and the rest not. That order isn't covered by a test yet | Sending only part of a list, which unwatches the rest, or leaving out revision, which saves over any change made since |
| A saved draft create timed out | Nothing. No route lists saved drafts, so the draft can't be looked up | Send it again only if a second draft is acceptable | Sending it again in a loop, which can save several |
| A saved draft edit timed out | GET /reddit/drafts?id=, and compare versions[-1] with your edit | Send the edit again only if the newest version isn't yours | Sending it again without reading, which adds another version |
Reddit outreach batches
| State | Read first | Safe action | Unsafe action |
|---|---|---|---|
| The submit answer was lost | GET /reddit/outreach?id= if you have the batch_id | Send the identical body again with the same idempotency_key. It answers the original batch and queues nothing again | A new idempotency_key, which is new work and can post again. Changed content with the same key answers 409 idempotency_conflict |
A row's status is send_unknown | GET /reddit/outreach?id=, then the post, comment or message on Reddit | Leave the row as it is. S'more never sends it again on its own, and later sends from the same account wait while the result is unknown | Submitting the row again, or the same text under a new key, which can post it twice. No API route settles an unknown row |
The batch is paused with next_action.type reconnect_reddit | GET /reddit/outreach?id= for next_action.url | An owner or admin reconnects the same Reddit account in Settings at next_action.url. As resume_policy says, the batch resumes after the same account reconnects | Submitting the rows again from another account, because the first batch can still send once its account is back |
can_send is false on GET /reddit/accounts | GET /reddit/accounts | Reconnect that account in Settings at connect_url | Submitting from it before it's reconnected |
| You cancelled while rows were sending | GET /reddit/outreach?id=, each row's status | Check which rows went. Cancelling again is safe | Treating the cancel as proof that nothing went out. A row already sent stays sent, and a row being sent as you cancel may still go |
S'more doesn't promise exactly-once delivery. Retries explains why, and Timeouts lists each route's deadline. Work through the Reddit API shows these reads in a full flow.