Bluesky app fork with some witchin' additions 💫

Add some device location debug (#9693)

authored by

Eric Bailey and committed by
GitHub
bbab7695 26aa7c0d

+13
+13
src/geolocation/device.ts
··· 1 1 import {useCallback, useEffect, useRef} from 'react' 2 + import {Platform} from 'react-native' 2 3 import * as Location from 'expo-location' 3 4 import {createPermissionHook} from 'expo-modules-core' 4 5 ··· 57 58 }) 58 59 const location = locations.at(0) 59 60 const normalized = location ? normalizeDeviceLocation(location) : undefined 61 + if (normalized?.regionCode && normalized.regionCode.length > 5) { 62 + /* 63 + * We want short codes only, and we're still seeing some full names here. 64 + * 5 is just a heuristic for a region that is probably not formatted as a 65 + * short code. 66 + */ 67 + logger.error('getDeviceGeolocation: invalid regionCode', { 68 + os: Platform.OS, 69 + version: Platform.Version, 70 + regionCode: normalized.regionCode, 71 + }) 72 + } 60 73 return { 61 74 countryCode: normalized?.countryCode ?? undefined, 62 75 regionCode: normalized?.regionCode ?? undefined,