Scanner API is returning stale data, again. v2026-01

Hello there.

I’m migrating from 2025-07 to 2026-01 and I’m not only moving every single component from the react package to the polaris components (how fun and productive!) one of my favorite buggy behaviors are back.

If you use the

  useEffect(() => {
    const unsubscribeData = shopify.scanner.scannerData.current.subscribe((result) => {
      setScanData(result.data || '');
      setScanSource(result.source || '');
    });

    const unsubscribeSources = shopify.scanner.sources.current.subscribe((sources) => {
      setHasCameraScanner(sources.includes('camera'));
      setHasExternalScanner(sources.includes('external'));
    });

    return () => {
      unsubscribeData();
      unsubscribeSources();
    };
  }, []);

and get the scan data, you can do stuff with it. Nice.

And if you unmount this scanner component and mount another one, in the same extension/modal, if you go back to the scanner component with a new mount with the intention of scanning something new again, the current subscription already returns the old/stale scan data.

Even tho I’ve already called the unsub function, there’s stale data from a scan that is 5 minutes ago, still being returned in the current object.

Now I have to write a custom scanner state management on top of your scanner subscribeable because it’s not being cleared properly.

bump bump bump anyone here?

Is this topic the same issue?

hey @Dylan, yes and no.

because your original post is/was outdated, as this issue was resolved (at least until now v2026-01 reintroduces it). commented on your post to bump it up and wanted to get my own going for more visibility.

Ah gotcha, thanks. I didn’t even realize it was temporarily fixed. But I’m in the same boat, I need to refactor to the polaris components.

Good luck with the polaris migration :vulcan_salute: