Skip to content

[codex] Prevent stale xPoster image markers#1

Open
aa755 wants to merge 1 commit into
nevertoday:mainfrom
aa755:codex/fix-xposter-marker-race
Open

[codex] Prevent stale xPoster image markers#1
aa755 wants to merge 1 commit into
nevertoday:mainfrom
aa755:codex/fix-xposter-marker-race

Conversation

@aa755

@aa755 aa755 commented Jun 30, 2026

Copy link
Copy Markdown

PR created and submitted by codex

What changed

This makes Article imports fail-safe when X's async media upload flow races with xPoster's marker cleanup.

  • Waits for any uploaded body images that still lack media IDs to settle before final cleanup.
  • Repeatedly removes xPoster marker tokens until the live Draft.js editor is stably marker-free.
  • Tracks remaining marker count in the import summary.
  • Throws a clear "Do not publish" error if any __XPOSTER_... marker survives cleanup.

Why

A real published Article ended up with an image marker such as __XPOSTER_f4m2b_IMAGE_1__ visible above an uploaded image. The likely interleaving is that xPoster removed a marker, then X applied a later media-upload state update from an older editor snapshot that still contained that marker. The image upload succeeded, but the temporary marker came back.

Validation

  • npm run check passed.
  • git diff --check passed.
  • npm test currently fails on upstream main before reaching this change: shared.normalizeAiCoverSettings is not a function in scripts/smoke-test.js.

@aa755 aa755 marked this pull request as ready for review June 30, 2026 00:58
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.

1 participant