Skip to content

fix(pinterest): retry transient 'Something went wrong on our end' errors - #1907

Merged
egelhaus merged 1 commit into
stagingfrom
fix/pinterest-transient-error
Aug 29, 2026
Merged

egelhaus merged 1 commit into
stagingfrom
fix/pinterest-transient-error

Conversation

@giladresisi

@giladresisi giladresisi commented Aug 17, 2026 •

Copy link
Copy Markdown
Collaborator

What kind of change does this PR introduce?

Bug fix (backend, Pinterest provider error mapping). Adds a Something went wrong on our end branch to PinterestProvider.handleErrors returning type: 'retry', so SocialAbstract.fetch retries the call up to three times roughly five seconds apart before falling through to a BadBody. Pinterest returns this body for transient failures on their side, which previously fell through handleErrors and failed the post on the first hit as "Unknown Error". The retry budget is the existing one in SocialAbstract.fetch - no new retry mechanism is introduced, and the existing bad-body branches are unchanged.

Why was this change needed?

Pinterest's POST /v5/pins intermittently 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, so fetch threw a non-retryable BadBody with the Unknown Error placeholder 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 in social.abstract.ts re-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 the BadBody, 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

  1. Connect a Pinterest channel and select a board
  2. Put a proxy or stub in front of the Pinterest pins endpoint so it returns a body containing "Something went wrong on our end"
  3. Publish a pin - backend logs show three attempts roughly five seconds apart before the post fails
  4. Change the stub so it returns the error only on the first call - the pin publishes on the retry and exactly one pin appears on the board
  5. Remove the stub and publish a pin normally to confirm the happy path is unaffected
  6. Confirm a "Board not found" error still fails immediately rather than retrying

Checklist:

  • I have read the CONTRIBUTING guide.
  • I have signed the Contributor License Agreement (CLA) (ICLA for individuals, CCLA for entities).
  • I confirm I have not used AI to submit this PR or generate code for it.
  • I checked that there were no similar issues or PRs already open for this.
  • This PR fixes just ONE issue

🤖 Generated with Claude Code

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>
@postiz-contribution
postiz-contribution Bot changed the base branch from main to staging August 17, 2026 09:00
@postiz-contribution postiz-contribution Bot added the contribution:approved Approved contributor label Aug 17, 2026
@postiz-agent

postiz-agent Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@egelhaus
egelhaus added this pull request to the merge queue Aug 29, 2026
Merged via the queue into staging with commit fdb30fa Aug 29, 2026
11 checks passed
@egelhaus
egelhaus deleted the fix/pinterest-transient-error branch August 29, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution:approved Approved contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants