Summary
Before clicking the post/reply button, automation has no first-class check that the Draft.js compose field contains the intended body exactly once and the URL exactly once on its own line. A small verify helper would catch double/replace/caret bugs before publish.
Repro
- Context: x.com compose after multi-step type/insert.
- Steps:
- Build draft via body insert + URL append.
- Read compose text (execute_js / read helpers).
- Click
[data-testid=tweetButtonInline] or reply button without structural assert.
- Observed: doubled or mangled drafts can be published; failures only noticed after the fact.
Code pointers (verified against /workspace/FSB)
extension/site-guides/social/twitter.js — tweetButtonInline, tweetTextarea_0, reply button selectors (~L47–143).
extension/content/actions.js — draft editable resolve / text read surfaces; likely area to add verify_draft or export a shared assert used by tools.
mcp/src/tools/manual.ts — tool registration pattern for a new optional helper.
Proposed fix
Add a lightweight helper (content or MCP-facing) that reads compose text from the resolved editable and asserts: body substring once, URL once, URL preceded by newline (or on last line). Fail closed before click on tweet button.
Acceptance / regression
- Helper fails on doubled body or mid-line URL; passes on well-formed draft.
- Integrates with existing selectors in
twitter.js site guide.
Owner
extension (helper); mcp-server if exposed as a tool
Priority: P2 · Owner: extension
Summary
Before clicking the post/reply button, automation has no first-class check that the Draft.js compose field contains the intended body exactly once and the URL exactly once on its own line. A small verify helper would catch double/replace/caret bugs before publish.
Repro
[data-testid=tweetButtonInline]or reply button without structural assert.Code pointers (verified against /workspace/FSB)
extension/site-guides/social/twitter.js—tweetButtonInline,tweetTextarea_0, reply button selectors (~L47–143).extension/content/actions.js— draft editable resolve / text read surfaces; likely area to addverify_draftor export a shared assert used by tools.mcp/src/tools/manual.ts— tool registration pattern for a new optional helper.Proposed fix
Add a lightweight helper (content or MCP-facing) that reads compose text from the resolved editable and asserts: body substring once, URL once, URL preceded by newline (or on last line). Fail closed before click on tweet button.
Acceptance / regression
twitter.jssite guide.Owner
extension (helper); mcp-server if exposed as a tool
Priority: P2 · Owner: extension