Skip to content

Detect account switcher race / session flip mid-compose and abort send #136

Description

@Trace824

Summary

During compose, SideNav / account session can flip (user or another client). Sending without detecting the flip risks posting as the newly active account. Contended shared Chrome sessions amplify this.

Repro

  • Context: Compose open; second actor (or UI) switches account via SideNav.
  • Steps:
    1. Start compose as account A.
    2. Trigger account switch to B mid-compose (SideNav).
    3. Click post/reply.
  • Observed: post goes out as B; SideNav may have shown A earlier in the flow. TAB_NOT_OWNED can also appear when another agent owns the tab (extension/utils/agent-tab-resolver.js).

Code pointers (verified against /workspace/FSB)

  • extension/site-guides/social/twitter.js — account switcher + tweet button selectors.
  • extension/utils/agent-tab-resolver.jsTAB_NOT_OWNED.
  • extension/content/actions.js — click handlers for send; likely area to snapshot identity at compose-open and re-check at send.
  • mcp/README.md — multi-agent ownership (TAB_NOT_OWNED).

Proposed fix

Snapshot account identity when compose is focused; on tweet-button click, re-read identity and abort if changed. Optionally combine with tab-ownership errors so soft contention fails closed.

Acceptance / regression

  • Mid-compose switch → send aborted with clear error.
  • No twin or wrong-account publish in the race window.

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