Skip to content

Studio Code can switch to an older composition after a delayed source response #7431

Open

Description

@AksharP5

Affected workflow

Switching compositions quickly can leave Code editing an older composition while the preview shows the latest selection. The composition source loader accepts every response, even after another composition has been selected.

Reproduced on main e351253724c7142cc4697de652f353a0fd74b66e (v0.9.26), Linux arm64, Bun 1.4.4 and Chrome 153.0.8010.36.

Reproduction

  1. Open a project containing two compositions and open the Code panel.
  2. Select the first composition while its /api/projects/<project>/files/<composition> source request is delayed.
  3. Select the second composition and let its source request finish.
  4. Let the first composition's request finish.

The browser reproduction uses the repository's ghost-lane fixture: select groups.html, then index.html, and release the held groups.html source request last. It drives the real Compositions and Code panels with Puppeteer and does not change the source responses.

Expected and actual

The preview and Code should stay on index.html. Instead, the preview still has composition root ghost-lane, but Code switches to groups.html, whose source title is Grouped track drop fixture. A subsequent source edit therefore targets a different composition from the one being previewed.

An obsolete failed request can also show an error after a newer composition has loaded successfully. Focused tests reproduce that behavior and responses accepted after project changes or unmount.

Evidence

Code shows groups.html while the preview still shows index.html

Browser reproduction script and observed baseline result.

The cause is in packages/studio/src/hooks/useCompositionContentLoader.ts: the success and error callbacks have no request-ownership check. Current source loads must retain their loading placeholder and error reporting, while superseded loads must no longer update the editor or report errors.

Activity

  1. added
    bugSomething isn't working
    triage/readyAccepted scope, current evidence, acceptance criteria, and validation path are recorded.
    difficulty/easyLocalized change with a known approach, limited risk, and straightforward verification.
    on Nov 9, 2026
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

    bugSomething isn't workingdifficulty/easyLocalized change with a known approach, limited risk, and straightforward verification.triage/readyAccepted scope, current evidence, acceptance criteria, and validation path are recorded.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions