I spent a day wiring up automated publishing to several social platforms. Most of the work was not "call an API" - it was finding the small, undocumented behaviours that quietly break a post. Here are the nine that cost me the most time, with what actually worked.

1. Rich text editors reuse drafts

A common failure mode: you open a composer, type, and the resulting post contains the previous draft plus your new text. If the network hiccups before you publish, the editor silently keeps state.

What worked: detect the leftover text first, discard the draft, then start clean. Never assume an empty composer is empty.

2. Inserting multi-line text is not the same as typing it

Sending a single insertText payload containing newline characters produced collapsed lines and duplicated fragments in one editor.

What worked: insert one line at a time and send a real Enter key event between lines.

3. Verify before you submit

Before clicking publish, check three things: the text matches character-for-character, the media is actually attached, and the submit control is enabled (check its disabled attribute rather than trusting the visual state).

After publishing, the fastest success signal was usually "is the editor empty now?" - much cheaper than reloading the public page.

4. File inputs have a fixed order

A profile editor silently mapped the first file input to a banner and the second to an avatar. Uploading them in the wrong order produced a profile with an avatar stretched across the banner.

What worked: inspect the file inputs, map each one to its field, and download the live published image afterwards to confirm - the in-page preview lied.

5. A web composer can crop an image without telling you

One platform's web composer defaulted to a square crop with no aspect-ratio control. Uploading a 4:5 image and reading back the published asset showed 1080x1080 - the 4:5 framing was gone.

What worked: publish tall images from the mobile app, then read back the published dimensions to confirm nothing was cropped.

6. The grid is not the post

The profile grid thumbnail rendered at 3:4 even though the post itself was 4:5. If a design depends on edge placement, it will be clipped in the grid.

What worked: keep important elements inside a centre safe area.

7. API keys are one-time values

Several platforms show a generated key exactly once. Miss the reveal and you have to revoke and regenerate. If a key endpoint returns 401 for every header style, the key itself is dead - check that before debugging your client.

What worked: write the key to a chmod 600 file the moment it appears, and prove it with a single read call before building anything on top of it.

8. Localhost vs LAN matters for links

Dashboards served on a LAN address were unreachable from a browser routed through a SOCKS proxy, while curl from the host worked fine. "It works on the command line" is not evidence the browser can open it.

What worked: hand people 127.0.0.1 links when the service runs locally, and verify the exact URL in the target environment.

9. Slug casing is not always normalised the way you expect

One platform redirected a capitalised username to a lowercase path that returned 404, which initially looked like "the profile is gone". A control request against a second account showed the difference immediately.

What worked: always test with a control - one known-good URL next to the failing one. It separates "my code is wrong" from "this account is restricted" in seconds.

The pattern

Almost every bug was a mismatch between what the UI showed and what the server stored. The fix was the same each time: read back the stored value - the published post, the live image, the actual dimensions, the API response - instead of trusting the editor.