Skip to content

[Bug]: Overlapping image pastes can reverse inline prompt references #37009

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Open a thread and type Compare into the composer.
  2. Paste one PNG that needs image preparation.
  3. At the unchanged caret, paste another PNG while the first is still preparing.
  4. Let the first preparation finish, followed by the second.

The shipped scenario scripts/scenarios/overlapping-image-pastes-keep-order.e2e.ts uses real wide PNGs, keyboard clipboard paste, and a gate around bitmap decoding to reproduce the overlap while preserving normal preparation.

Expected behavior

Inline image references follow paste order: first image, then second image.

Actual behavior

The inline references appear in reverse order when the first preparation finishes first. Both images survive. Sequential pastes and overlapping pastes where the second finishes first retain the expected order.

Impact

Minor bug or occasional failure. Timing-dependent; no incidence or preparation duration was measured.

Version or commit

pingdotgg/main @ fe59fa4

Environment

Chromium, Linux, web composer. Provider-independent. Native mobile was not exercised.

Logs or stack traces

The original public editor/hook repro fails on main with Before second.png first.png instead of Before first.png second.png. Independently confirmed twice by Claude Opus 5.5 on f5ca0f9, then reproduced again on current main before this fix.

Workaround

Wait for each image to finish preparing before pasting the next.

Activity

  1. added
    vouch:trusted
    on Nov 15, 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

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions