useRecentProducts with "cache-first" never finishes loading on new Shop app installs

Environment

SDK Version: @shopify/shop-minis-react@0.4.7
CLI Version: @shopify/shop-minis-cli@0.0.216
Device: Android device (Google Pixel 9A)
Development OS: macOS 26.1
Mini Handle: help-me-choose

Issue

What’s broken: useRecentProducts hook with “cache-first“ fetch policy indefinitely loads on new Shop app installs
Expected behavior: useRecentProducts should return the cached recently used products, or if cache isn’t available - fetch new recently used products
Actual behavior: useRecentProducts is permanently stuck in a loading state with no error message

Reproduction steps

  1. Uninstall the shop minis development app.

  2. Launch the mini on an android device.

  3. Have a useRecentProducts hook with “cache-first” fetch policy on the home page.

  4. The loading of the hook will never end.

Code example

const { products, loading, error } = useRecentProducts({ first: 20, fetchPolicy: 'cache-first' });

return (<p>{products?.length??'null'} {loading.toString()} {error?.message??'no error'}</p>);

Already Tried

  • First and foremost: have I read the docs? - Yes, although there isn’t any further explanation on fetch policy there (for example how long cache is stored for)

  • Confirmed scopes match what I’m accessing - Yes

  • I’ve run npx shop-minis upgrade to make sure I’m on the latest versions - Yes

  • The issue is fixed when you click “Reload Mini” in the development environment.

  • Does not seem to occur on an iPhone emulation in my testing.

Thanks for reporting the issue @borislav . This hook would not return any data if the user hasn’t viewed any products before, but it should still throw a proper error when this case occurs. We’ll review the SDK and make updates as needed.

Thanks.

Is the hook supposed to return recently viewed products for the instance of the app itself, in the first place? My account has recently viewed products, but the issue occurs the first time I use a newly installed instance of the app regardless, which seems unintuitive.

Hi @Tunca-Shopify - I am also struggling with same problem. Recently viewed products are not being returned by the SDK. However, I can see recently viewed products on the Shop App home page.

I am using android emulator. I have even tried fetchPolicy: ‘network-only’ still facing problems.

The behavior is unusual, it sometimes return the products and the results are correct. But most of the time it stuck on loading.

I believe this will not be the case on the live Shop App with our sho-minis

Thank you in advance.