Skip to content

[Bug]: Composer # suggestions collapse reviews from different Git hosts #36099

Closed

Description

@simon-easyprog

Before submitting

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

Area

packages/shared; composer suggestions in apps/web (also desktop) and apps/mobile.

Steps to reproduce

Two unrelated public reviews share the repository path wireshark/wireshark and number 1:

At the baseline commit below, run this from packages/shared in a dependency-installed checkout. It creates in-memory linked-review fixtures only; it does not access a T3 database or fetch live review metadata.

// node --input-type=module
import {
  composerPullRequestsFromLinks,
  filterComposerPullRequestMatches,
  withLinkedComposerPullRequestsFirst,
} from "./src/composerPullRequestMatches.ts";

const links = [
  {
    host: "github.com",
    url: "https://github.com/wireshark/wireshark/pull/1",
    title: "Corrected a typo.",
  },
  {
    host: "gitlab.com",
    url: "https://gitlab.com/wireshark/wireshark/-/merge_requests/1",
    title: "Add merge request jobs to GitLab CI and migrate commit validation.",
  },
].map(({ host, url, title }) => ({
  host, url, repository: "wireshark/wireshark", number: 1,
  source: "manual", linkedAt: "2026-11-12T00:00:00.000Z", stack: null,
  snapshot: {
    title, state: "merged", headBranch: "fixture-review", baseBranch: "master",
    isDraft: false, updatedAt: "2026-11-12T00:00:00.000Z",
    syncedAt: "2026-11-12T00:00:00.000Z",
  },
}));
for (const order of [links, [...links].reverse()]) {
  const linked = composerPullRequestsFromLinks(order, "project");
  console.log(filterComposerPullRequestMatches({
    entries: [], linked, projectId: "project",
    repository: "wireshark/wireshark", query: "1", limit: 20,
  }).map(({ url }) => url));
}
const linked = composerPullRequestsFromLinks(links, "project");
console.log(withLinkedComposerPullRequestsFirst({
  matches: [{ ...linked[0] }], linked, query: "wireshark", limit: 20,
}).map(({ url }) => url));

The same numeric failure was captured in the real web client using an isolated Replay (dev) thread with these seeded linked snapshots: both reviews exist in the thread details, but typing #1 offers only one Wireshark review. The snapshot URLs/titles are public; dates, branches, and sync metadata are fixture values. This is not a claim that review metadata was fetched live.

Expected behavior

Both matching reviews appear as distinct selectable suggestions, with their own URLs. A searched entry should replace a linked entry only when both refer to the same review. Two appearances of the same review should still deduplicate.

Actual behavior

The first numeric call returns only the GitHub URL. Reversing the link order returns only the GitLab URL. The text-search call returns the GitHub URL twice, substituting it for the linked GitLab review.

composerPullRequestsFromLinks drops host, and both shared helpers key by normalized repository#number only. Web and mobile menu row IDs also omit the host; mobile additionally deduplicates text results by number alone. The normal thread review identity helper already distinguishes these hosts correctly.

Stored links remain intact, and full-URL paste still works. This is a suggestions identity collision, not data loss or the timestamp-sorting problem in #35125.

Impact

Minor bug or occasional failure: a matching linked review cannot be selected through the numeric suggestions.

Version or commit

Reproduced on main at 4fd40e1a16e3800418b8f6a32932b68179098c8d, after the timestamp-sorting fix.

Environment

Linux; real Chromium web client with isolated development state and Replay (dev). The shared helpers were also executed directly with the in-memory fixtures above. No paid provider turn is required.

Workaround

Paste the review's full URL in the composer.

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