Resource Picker silently drops pre-selected variants after searching by variant ID

Summary

When a product is passed in selectionIds with variant A, and the merchant searches for variant B of the same product and ticks it, the picker returns that product with only variant B. Variant A is removed from the result without any warning.

The picker’s “N products selected” counter does not change, so the merchant has no way to notice. Apps that re-open the picker with existing selections (bundles, discounts, upsells) lose data on save.

This looks like the same root cause as the confirmed bug in Variants deselected in Resource Picker if “Load all variants” isn’t reloaded. The picker seems to rebuild a product’s selection from the variants loaded in the current view, and drops pre-selected variants it hasn’t loaded. This trigger doesn’t need a product with 50+ variants, so it should be easier to reproduce.

Steps to reproduce

  1. Take any product with 2 or more variants. Call them A and B.
  2. Open the picker with variant A pre-selected:
const result = await shopify.resourcePicker({
  type: "product",
  action: "select",
  multiple: true,
  selectionIds: [
    {
      id: "gid://shopify/Product/<PRODUCT_ID>",
      variants: [{ id: "gid://shopify/ProductVariant/<VARIANT_A_ID>" }],
    },
  ],
  filter: { draft: false, archived: false, variants: true, hidden: false },
});

const selection = Array.isArray(result) ? result : result?.selection ?? [];
console.log(selection.map((p) => ({ product: p.id, variants: p.variants.map((v) => v.id) })));
  1. Switch the search mode to “Search by Variant ID” and search <VARIANT_B_ID>. Only variant B of the product is listed.
  2. Tick variant B.
  3. Click Select.

Expected

The product is returned with variants [A, B].

Actual

The product is returned with variants [B]. Variant A is missing.

Observations

  • Input vs output logged in the same call. selectionIds contained variant A. The returned selection did not.
  • Only B is loaded during the search. The picker’s network request for that search is ProductResourcePicker with variantsSearchQuery: id:"<VARIANT_B_ID>", so variant A is never loaded in that view.
  • The UI confirms A is gone. After step 5, re-open the picker with the returned selection pre-selected and search A again: it shows unticked, while the “N products selected” counter stays the same.
  • Needs Select in between. It happens when the picker is closed with Select between the two picks: search A → tick → Select, then re-open → search B → tick → Select, and A is dropped. Searching and ticking A and B in the same picker session, with one Select at the end, returns both.

Impact

A merchant lost several products and variants from a bundle this way. They built the selection over several picker sessions, searching by variant or SKU. Everything looked correct in the picker, and the loss only showed up on the storefront.

Environment

  • App Bridge loaded from the Shopify CDN (current as of 30 Sep 2026)
  • shopify.resourcePicker with type: "product", multiple: true, filter.variants: true
  • Embedded app in the Shopify admin, Chrome

Solid repro, this matches the linked bug pattern. As a workaround until it’s fixed, don’t trust the picker’s returned selection as authoritative across sessions, merge it client side with your own previously stored selection before saving, and re-derive selectionIds from that merged set on every reopen.