Skip to content

Put Instagram Graph status on still-processing exceptions - #351

Closed
paulocastellano wants to merge 2 commits into
mainfrom
cursor/instagram-poll-status-in-exception-5038
Closed

Put Instagram Graph status on still-processing exceptions#351
paulocastellano wants to merge 2 commits into
mainfrom
cursor/instagram-poll-status-in-exception-5038

Conversation

@paulocastellano

Copy link
Copy Markdown
Contributor

Nightwatch caught PlatformUnavailableException: Instagram is still processing container 18630170011019893 on PublishToSocialPlatform (335ms, social-instagram). That is the retry-exhausted path — Instagram stayed non-terminal for the whole poll budget (~90 × 10s). Nightwatch Exceptions only stores class/message/stack, and this exception view had Logs: Not captured, so Graph status_code / status never appeared.

This change puts that payload on the exception itself so the next Nightwatch hit is readable without the log channel.

What changed

  • Pending-container exception message now includes Graph status_code and status (e.g. … (status_code=IN_PROGRESS, status=In progress: Media is still being processed.)).
  • instagram_status_detail is stored on the checkpoint next to instagram_status.
  • If Graph returns only status: "Error: Media download has failed…" (empty status_code), we fail immediately as media-processing-failed instead of burning 15 minutes of retries.
  • In-flight Publish rescheduled: platform unavailable warnings now include content_type and the media snapshot.

Unchanged

  • User-facing emails (posts.errors.platform_unavailable / platform_unavailable_exhausted / Instagram media processing failed).
  • In-flight retries still Log::warning only; report() still happens only when retries are exhausted.

After deploy, the Nightwatch exception message should carry the Graph status even when Logs stay empty.

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 11, 2026 18:29
Nightwatch only stores class/message/stack, so a 15-minute IN_PROGRESS
poll ended as "still processing container" with no Graph payload. The
exception message now includes status_code and status, and a Graph
status that is only "Error: …" fails immediately instead of burning
the retry budget.

Co-authored-by: Paulo Castellano <hello@paulocastellano.com>
Event::fake() swallows MessageLogged, so Log::listen never saw the
warning. Fake only PostPlatformStatusUpdated.

Co-authored-by: Paulo Castellano <hello@paulocastellano.com>
@paulocastellano
paulocastellano marked this pull request as ready for review September 11, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants