Skip to content

Draft.js X compose: selector click/type timeout — harden draft_fast_path as default for tweetTextarea_0 #127

Description

@Trace824

Summary

Selector click / type_text on X’s [data-testid=tweetTextarea_0] can hang ~10s because readiness, stability, and captureActionState burn the messaging budget on a busy SPA. draft_fast_path already skips that stack when detected; it should be the reliable default for this compose surface.

Repro

  • Context: Active tab on x.com with compose open ([data-testid=tweetTextarea_0]).
  • Steps:
    1. Call selector click then type_text on tweetTextarea_0 without CDP.
    2. Observe wall time and success/timeout (~10s messaging budget).
  • Observed: hangs or timeouts; with draft_fast_path loaded, returns method: draft_fast_path in ≪10s (append quirks tracked separately).

Code pointers (verified against /workspace/FSB)

  • extension/content/actions.js — captureActionState (~L217; avoids full document.body.innerText); isDraftLikeEditable / shouldUseDraftFastPath / findDraftEditableRoot (~L2121–2155); type fast-path (~L2959–3008) returns method: 'draft_fast_path'; click fast-path (~L2408).
  • extension/content/messaging.js — tool dispatch / timeout budget (Unknown-tool and tool handlers).
  • Local branch already contains draft_fast_path; harden detection + ensure always taken for tweetTextarea_0.

Proposed fix

Treat data-testid=tweetTextarea_0 (and nested contenteditable) as always-fast-path on x.com/twitter.com: skip smartEnsureReady / waitForPageStability / heavy captureActionState for click+type. Keep CDP click_at/insert_text as the recommended alternate path in docs.

Acceptance / regression

  • Selector click+type on compose completes well under 10s and reports draft_fast_path.
  • Non-Draft inputs unchanged (still use readiness/verify).
  • Regression test or harness covering shouldUseDraftFastPath for tweetTextarea_0.

Owner

extension


Priority: P1 · Owner: extension

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions