Previously the location id was always present and able to be used, however last night there were a number of incidents where it was undefined.
According to the documentation this should never be the case Session API
I’m guessing this similar to the issue with get session token, where it has to be polled because it can be undefined when the device first wakes up.
Please can this be investigated or the types updated if its expected to not always be present please
@JordanFinners hey Jordan,
Do you have reproduction steps, or could you provide the target(s) that this was occurring on?
Hey JS,
It happen when the user went to create something on my apps, where I’m accessing the location like so props.api?.session.currentSession.locationId
I believe it was on POS version 11.6.1, saw a handful of them from around 6pm UK time to this morning.
Happening on pos.home.modal.render and pos.product-details.action.render both versioned 2025-07.
Hey @JS_Goupil
Just FYI I’m still seeing and getting feedback on this from my merchants as I need the location to operate, so currently telling them to just restart the POS app, which is far from ideal. I wondered if you had any options here?
It seems to be happening very sporadically
@JordanFinners sorry - was addressing other bugs. I found the issue here and will be able to get a fix out before the morning. It’s definitely a race condition of sorts, I haven’t been able to reproduce it myself.
Hi @JS_Goupil I’m also experiencing this issue intermittently across devices. For us it’s happening when we attempt to access api.session.currentSession.locationId not long after the extension has loaded.
I can give you request IDs for some failing GQL requests on the server side if that helps.
For us we are sending the location ID to our server which makes a GQL request using it, but because its undefined Shopify is returning a 500 error.
@simon_b if your extension loads the locations ID successfully once, does it ever regress later if POS is never killed? I’m trying to rule out a start up race condition
@JS_Goupil I think it only occurs when the extension starts, which seems to line up with it being a start up race condition.
All the instances of it that I can see occur just after the app starts (< 2s after).
Also this may just be a coincidence but it appears to be happening on iPads.
@simon_b if the merchant opens or renders another target, is it still undefined?
I’m not sure, I haven’t been able to reproduce it, and no one has reached out to report it surprisingly, but I can see from our error reporting that it’s occurred a number of times over the last week.
I was going to add a retry mechanism to these requests to retry when locationId is undefined.
@JS_Goupil I can provide timestamps of when it has occurred if that helps?
@simon_b sure! And actually, I just want to confirm, are these direct API requests? Or requests going from your backend to Shopify? Also can you provide your app ID? That would be most helpful. I’m more or less trying to gauge the impact, I do have a solution (98% sure) that we’ll roll out in the next few hours to have it be fixed for the folks in Europe
Some times:
May 26, 22:51:23 UTC
May 26, 16:37:36 UTC
May 26, 16:13:33 UTC
May 26, 16:13:00 UTC
May 26, 16:12:50 UTC
May 26, 14:29:03 UTC
May 26, 13:43:16 UTC
May 25, 21:36:22 UTC
May 25, 21:11:41 UTC
May 25, 21:08:45 UTC
May 25, 21:08:37 UTC
May 25, 21:07:51 UTC
May 25, 21:07:37 UTC
May 25, 20:52:16 UTC
May 25, 20:52:08 UTC
May 25, 17:51:41 UTC
May 25, 17:50:42 UTC
May 25, 17:50:32 UTC
May 25, 17:50:25 UTC
May 25, 17:50:03 UTC
May 25, 17:49:44 UTC
May 25, 17:49:41 UTC
May 25, 13:22:34 UTC
I just deployed a change to the POS app to retry if the location ID is undefined, will let you know if I see it occur again.
@simon_b thanks for all of your help. We deployed a change about an hour ago that should fix the problem. Let me know if any of your merchants are still experiencing symptoms. Cc @JordanFinners
Good stuff @JS_Goupil! Will do.
Cheers mate!