fix(pinterest): retry transient 'Something went wrong on our end' errors - #1907
Merged
Merged
Conversation
Pinterest's pin creation endpoint intermittently answers with
{"code":2787,"message":"Sorry! Something went wrong on our end."}.
It was unmapped in handleErrors, so the post failed immediately as a
non-retryable BadBody with the 'Unknown Error' placeholder, even though
identical requests succeed minutes later.
Map it to a retry (3 attempts, 5s apart) with a curated message so a
short Pinterest hiccup no longer fails the post, and if it persists the
user sees what actually happened instead of 'Unknown Error'.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Merged
11 tasks
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 kind of change does this PR introduce?
Bug fix (backend, Pinterest provider error mapping). Adds a
Something went wrong on our endbranch toPinterestProvider.handleErrorsreturningtype: 'retry', soSocialAbstract.fetchretries the call up to three times roughly five seconds apart before falling through to aBadBody. Pinterest returns this body for transient failures on their side, which previously fell throughhandleErrorsand failed the post on the first hit as "Unknown Error". The retry budget is the existing one inSocialAbstract.fetch- no new retry mechanism is introduced, and the existingbad-bodybranches are unchanged.Why was this change needed?
Pinterest's
POST /v5/pinsintermittently answers with{"code":2787,"message":"Sorry! Something went wrong on our end."}. This is a transient error on Pinterest's side: identical pins (same board, link, image) go through minutes before and after. Between Aug 12 and Aug 14 we saw a spike of these across many accounts, and two customers reported it.The response was unmapped in
PinterestProvider.handleErrors, sofetchthrew a non-retryableBadBodywith theUnknown Errorplaceholder on the first attempt: the post failed for good and the customer only saw "An error occurred while posting on pinterest: Unknown Error".This maps the message to
type: 'retry', so the existing retry path insocial.abstract.tsre-attempts up to 3 times (5s apart). If it still fails, the curated message ("Pinterest reported a temporary error on their side. Please try posting again.") is carried into theBadBody, so once #1868 lands it is surfaced in the calendar tooltip instead of the generic text.Other information:
Same shape as the existing "Unable to reach the URL" retry mapping in the same provider. Not exercised end to end against Pinterest (the error is not reproducible on demand); the retry and message plumbing are the existing paths already used by that mapping.
QA
Checklist:
🤖 Generated with Claude Code