Skip to main content

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​

StateRead firstSafe actionUnsafe action
503 request_timeout on a writeThe resource's own readAct on what the read shows. The work may have finished, and the call is refundedSending the write again before you read
409 revision_conflictThe resource again, for its current revisionApply your change to what you just read, then send it with the new revisionSending 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_limitedNothingWait for Retry-After, then retryRetrying at once
409 reddit_signals_off, 503 reddit_mentions_disabled or 503 outreach_disabledNothingWait until the product opens. Gates lists what each closed product answersRetrying in a loop

Watched subreddits and saved drafts​

StateRead firstSafe actionUnsafe action
A watch change on PUT /reddit/subreddits failed or timed outGET /reddit/subredditsCompare 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 yetSending 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 outNothing. No route lists saved drafts, so the draft can't be looked upSend it again only if a second draft is acceptableSending it again in a loop, which can save several
A saved draft edit timed outGET /reddit/drafts?id=, and compare versions[-1] with your editSend the edit again only if the newest version isn't yoursSending it again without reading, which adds another version

Reddit outreach batches​

StateRead firstSafe actionUnsafe action
The submit answer was lostGET /reddit/outreach?id= if you have the batch_idSend the identical body again with the same idempotency_key. It answers the original batch and queues nothing againA 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_unknownGET /reddit/outreach?id=, then the post, comment or message on RedditLeave 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 unknownSubmitting 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_redditGET /reddit/outreach?id= for next_action.urlAn 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 reconnectsSubmitting 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/accountsGET /reddit/accountsReconnect that account in Settings at connect_urlSubmitting from it before it's reconnected
You cancelled while rows were sendingGET /reddit/outreach?id=, each row's statusCheck which rows went. Cancelling again is safeTreating 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.