A social publishing pipeline that never double-posts
Testing whether a scheduled publishing pipeline can survive failures, retries and crashes without posting twice or marking a post live before it is.
Environment
- Laravel 12
- SQLite (WAL)
- Queue workers
- Sandbox connector
- Playwright
Question
Can Studio, my AI social media platform, publish scheduled posts reliably when networks fail, rate-limit, revoke access or respond slowly, without ever sending the same post twice?
Hypothesis
An atomic claim before each step, an idempotency key per post and account, and "published only after the platform confirms it" together prevent duplicates and false successes.
Environment
- Studio running locally (Laravel 12, SQLite in WAL mode, queue worker and scheduler)
- A sandbox connector standing in for Facebook, Instagram, TikTok and YouTube. It stores posts, honours idempotency keys and can simulate: failing once, always rate-limited, a revoked token, slow processing and a policy rejection.
Method
- Every publish step starts with an atomic claim, so two workers never send the same post.
- Retryable errors back off after 1, 2, 4 and 8 minutes and give up after 5 attempts; authentication and policy errors fail at once.
- A post counts as published only after repeated status checks confirm it is live.
- A post stuck mid-publish for 15 minutes is marked interrupted and is never retried automatically; a manual retry reuses the same key.
- Run the automated test suite and a browser end-to-end scenario against each failure mode.
Observations
- Retrying with the same key never produced a second post in the sandbox feed.
- The idempotency key is derived from the post version, the account and the scheduled time.
Results so far
- The application test suite passes (157 tests).
- The publishing end-to-end scenario passes 8 of 8 checks.
Limitations
- Real social networks are not connected yet; that needs public hosting and approved developer apps. Their behaviour may differ from the sandbox.
- All runs so far are local, on one machine.
Next
Connect one real network once Studio is hosted, and repeat the failure scenarios against it.
Revision history
- r1 (24 Nov 2026): first write-up.
Related