From 65bf8aefc878f279a80325000e63a1ea35cc86b0 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 13 Jan 2026 10:14:39 -0600 Subject: [PATCH] Add some device location debug --- src/geolocation/device.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/geolocation/device.ts b/src/geolocation/device.ts index b98e6a2363..ac3ac0cbe1 100644 --- a/src/geolocation/device.ts +++ b/src/geolocation/device.ts @@ -1,4 +1,5 @@ import {useCallback, useEffect, useRef} from 'react' +import {Platform} from 'react-native' import * as Location from 'expo-location' import {createPermissionHook} from 'expo-modules-core' @@ -57,6 +58,18 @@ export async function getDeviceGeolocation(): Promise { }) const location = locations.at(0) const normalized = location ? normalizeDeviceLocation(location) : undefined + if (normalized?.regionCode && normalized.regionCode.length > 5) { + /* + * We want short codes only, and we're still seeing some full names here. + * 5 is just a heuristic for a region that is probably not formatted as a + * short code. + */ + logger.error('getDeviceGeolocation: invalid regionCode', { + os: Platform.OS, + version: Platform.Version, + regionCode: normalized.regionCode, + }) + } return { countryCode: normalized?.countryCode ?? undefined, regionCode: normalized?.regionCode ?? undefined,