Shopify / shopify-app-bridge

https://shopify.dev/docs/api/app-bridge
88 stars 9 forks source link

App Bridge Resource Picker on Mobile App Single Variant Bug #418

Closed charles-tyler closed 2 months ago

charles-tyler commented 2 months ago

Describe the bug

When using the App Bridge Resource Picker on the iOS or Andriod Shopify Mobile App (set to type = variant) it does not return "Single variant product" variant information.

This is only on the Mobile version of App Bridge, not on web. This is a new bug - first alerted to us towards the end of last week. It is happening on all of our apps.

For a visual comparison of the resource picker data between web and mobile, please refer to:

Issue:

To Reproduce

Steps to reproduce the behavior:

  1. Launch an embedded app from within the Shopify Mobile App
  2. Open the Product Resource Picker set to type = variant
  3. Select a product that is ‘hasOnlyDefaultVariant: true’
  4. Product variant information doesn't get passed from the API

For example in our app EasyScan.

https://github.com/user-attachments/assets/a8edbdbc-cc2c-42eb-8fbe-f23127f202dd

Expected behavior

To return the product variant information as shown in the Web version above.

Contextual information

Packages and versions

List the relevant packages you’re using, and their versions. For example:

Platform

henrytao-me commented 2 months ago

A fix for this will be merged soon. For clarification, I think the query you did should be for product query with filter.variants: false, not type: variant

shopify.resourcePicker({
    type: 'product',
    action: 'add',
    multiple: 10,
    filter: {
      hidden: true,
      variants: false,
      draft: true,
      archived: true,
    },
})
henrytao-me commented 2 months ago

It's fixed

charles-tyler commented 2 months ago

Unfortunately we are not observing this fix on the Shopify Mobile app, all of our embedded apps are still returning an empty array for the variant information for single variant products.

charles-tyler commented 2 months ago

A fix for this will be merged soon. For clarification, I think the query you did should be for product query with filter.variants: false, not type: variant

shopify.resourcePicker({ type: 'product', action: 'add', multiple: 10, filter: { hidden: true, variants: false, draft: true, archived: true, }, })

Yes, but we are still using App Bridge version 3.7.9. So ours is; options.showVariants: true

ResourcePicker.create(app, {
   resourceType: ResourcePicker.ResourceType.Product,
   options: {
    selectMultiple: 10,
    showHidden: true,
    showVariants: true,
    showDraft: true,
    showArchived: true,
    showArchivedBadge: true,
    showDraftBadge: true,
    initialSelectionIds,
   },
});
adambilt commented 2 months ago

@henrytao-me Can you please help take another look?

henrytao-me commented 2 months ago

Yes. I am on it.

henrytao-me commented 2 months ago

It works on prod now. Let's re-launch Shopify Mobile to apply the change :bow: