about summary refs log tree commit diff
path: root/src/lib/sentry.ts
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-04-16 14:38:25 -0700
committerGitHub <noreply@github.com>2024-04-16 14:38:25 -0700
commit69d376800619fc88f75252cf7f9b58629193850b (patch)
tree5511265b4e6e8bd5436b98f6d7d7f0527073548c /src/lib/sentry.ts
parent046e11de31a9e6ddda32811b1efab52f9c221616 (diff)
downloadvoidsky-69d376800619fc88f75252cf7f9b58629193850b.tar.zst
Better dist strings for Sentry (#3584)
* better version codes for sentry

* use a `.` to follow the same intended format as before

* ignore dist build number
Diffstat (limited to 'src/lib/sentry.ts')
-rw-r--r--src/lib/sentry.ts17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/lib/sentry.ts b/src/lib/sentry.ts
index 6b6c1832d..1180b0db6 100644
--- a/src/lib/sentry.ts
+++ b/src/lib/sentry.ts
@@ -5,16 +5,9 @@
 
 import {Platform} from 'react-native'
 import {nativeApplicationVersion, nativeBuildVersion} from 'expo-application'
-import * as info from 'expo-updates'
 import {init} from 'sentry-expo'
 
-/**
- * Matches the build profile `channel` props in `eas.json`
- */
-const buildChannel = (info.channel || 'development') as
-  | 'development'
-  | 'preview'
-  | 'production'
+import {BUILD_ENV, IS_DEV, IS_TESTFLIGHT} from 'lib/app-info'
 
 /**
  * Examples:
@@ -32,16 +25,16 @@ const release = nativeApplicationVersion ?? 'dev'
  * - `ios.1.57.0.3`
  * - `android.1.57.0.46`
  */
-const dist = `${Platform.OS}.${release}${
-  nativeBuildVersion ? `.${nativeBuildVersion}` : ''
-}`
+const dist = `${Platform.OS}.${nativeBuildVersion}.${
+  IS_TESTFLIGHT ? 'tf' : ''
+}${IS_DEV ? 'dev' : ''}`
 
 init({
   autoSessionTracking: false,
   dsn: 'https://05bc3789bf994b81bd7ce20c86ccd3ae@o4505071687041024.ingest.sentry.io/4505071690514432',
   debug: false, // If `true`, Sentry will try to print out useful debugging information if something goes wrong with sending the event. Set it to `false` in production
   enableInExpoDevelopment: false, // enable this to test in dev
-  environment: buildChannel,
+  environment: BUILD_ENV ?? 'development',
   dist,
   release,
 })