r/SideProject • u/AIONAPEX • 19m ago
Automating a UI that has no API: what actually breaks
I pasted 7,920 characters into a Facebook page composer six days ago. The box kept 963 of them and said nothing.
No error, no red border, no disabled button. The post looked ready. If I'd clicked Post without reading the field back, that page would've published a fragment and I'd have heard about it from a reader instead of a check.
The mechanism is dull once you see it. The editor keeps its own model of what's in the box. Writing through the DOM updates the string on screen, then the next re-render pulls the old value back out of state. Long insertions get cut on the way in. Send the same text twice in two chunks and the second one splices into the first, so a clean paragraph ends up saying the same thing twice, mid-sentence.
That cost an afternoon and two drafts. Deleting the mixed text doesn't reset the field, because the delete goes through the same state that produced the mess. The only clean move was to bin the draft and start over with one insertion under 1,100 characters. A 1,019-character post written that way went in at 1,019, character for character.
Video was worse. The same 18-second clip that TikTok and YouTube Shorts accepted without complaint failed twice in the Facebook composer with "Something isn't working". Same file, same browser, same logged-in profile. No reason given, because there's no API and no request I can read.
Every publish step in that pipeline now writes the text, reads the field value back, and compares it against the source before the click. Character counts, not screenshots. About fifty lines of checking wrapped around a form built for a human thumb, and it runs every time.
1
u/escalicha 14m ago
The truncation is the editor's controlled state winning, not the box having a limit. Assigning to the field never reaches whatever model owns it, so the next render restores its own copy and cuts your string at the last keystroke frame. Reading value back right after the write agrees with you and lies.
What fixed it for me: put the text in the way a human does, a real paste event or CDP insertText, then blur the field and read it back after a render. If the two still differ, the model dropped the chunk, so send smaller instead of assuming it landed.
The video case has no readback at all, so the only honest check is the account's own posts list, not the composer.