diff --git a/app.config.js b/app.config.js --- a/app.config.js +++ b/app.config.js @@ -37,7 +37,12 @@ // : undefined // const UPDATES_ENABLED = !!UPDATES_CHANNEL const UPDATES_ENABLED = IS_TESTFLIGHT || IS_PRODUCTION - const USE_SENTRY = Boolean(process.env.SENTRY_AUTH_TOKEN) + const USE_SENTRY = Boolean(process.env.EXPO_PUBLIC_SENTRY_DSN) + const IOS_BUILD_NUMBER = process.env.BSKY_IOS_BUILD_NUMBER || '1' + const ANDROID_VERSION_CODE = Number.parseInt( + process.env.BSKY_ANDROID_VERSION_CODE || '1', + 10, + ) const IOS_ICON_FILE = PLATFORM === 'web' // web build doesn't like .icon files @@ -65,6 +70,7 @@ ios: { supportsTablet: false, bundleIdentifier: process.env.WITCHSKY_BUNDLE_ID || 'app.witchsky', appleTeamId: process.env.WITCHSKY_APPLE_TEAM_ID || 'B3LX46C5HS', + buildNumber: IOS_BUILD_NUMBER, config: { usesNonExemptEncryption: false, }, @@ -204,6 +210,9 @@ backgroundColor: '#ED5345', }, googleServicesFile: './google-services.json', package: process.env.WITCHSKY_BUNDLE_ID || 'app.witchsky', + versionCode: Number.isFinite(ANDROID_VERSION_CODE) + ? ANDROID_VERSION_CODE + : 1, intentFilters: [ { action: 'VIEW', diff --git a/eas.json b/eas.json --- a/eas.json +++ b/eas.json @@ -8,32 +8,34 @@ "build": { "base": { "node": "20.19.4" }, - "development": { - "extends": "base", - "developmentClient": true, - "distribution": "internal", - "channel": "development", + "development": { + "extends": "base", + "developmentClient": true, + "distribution": "internal", + "channel": "development", "ios": { "simulator": true, "resourceClass": "large" + }, + "env": { + "EXPO_PUBLIC_ENV": "production", + "SENTRY_DISABLE_AUTO_UPLOAD": "true" + } }, - "env": { - "EXPO_PUBLIC_ENV": "production" - } - }, - "preview": { - "extends": "base", - "distribution": "internal", - "channel": "production", + "preview": { + "extends": "base", + "distribution": "internal", + "channel": "production", "ios": { "resourceClass": "large" + }, + "env": { + "EXPO_PUBLIC_ENV": "production", + "SENTRY_DISABLE_AUTO_UPLOAD": "true" + } }, - "env": { - "EXPO_PUBLIC_ENV": "production" - } - }, - "production": { - "extends": "base", + "production": { + "extends": "base", "ios": { "resourceClass": "large", "autoIncrement": true, @@ -42,14 +44,15 @@ }, "android": { "autoIncrement": true }, - "channel": "production", - "env": { - "EXPO_PUBLIC_ENV": "production" - } - }, - "production-apk": { - "extends": "base", - "distribution": "internal", + "channel": "production", + "env": { + "EXPO_PUBLIC_ENV": "production", + "SENTRY_DISABLE_AUTO_UPLOAD": "true" + } + }, + "production-apk": { + "extends": "base", + "distribution": "internal", "ios": { "autoIncrement": false, "buildArtifactPaths": ["ios/build/*"] @@ -57,13 +60,14 @@ }, "android": { "autoIncrement": false }, - "channel": "production", - "env": { - "EXPO_PUBLIC_ENV": "production" - } - }, - "testflight": { - "extends": "base", + "channel": "production", + "env": { + "EXPO_PUBLIC_ENV": "production", + "SENTRY_DISABLE_AUTO_UPLOAD": "true" + } + }, + "testflight": { + "extends": "base", "ios": { "autoIncrement": true, "buildArtifactPaths": ["ios/build/*"] @@ -71,14 +75,15 @@ }, "android": { "autoIncrement": true }, - "channel": "testflight", - "env": { - "EXPO_PUBLIC_ENV": "testflight" - } - }, - "testflight-android": { - "extends": "base", - "distribution": "internal", + "channel": "testflight", + "env": { + "EXPO_PUBLIC_ENV": "testflight", + "SENTRY_DISABLE_AUTO_UPLOAD": "true" + } + }, + "testflight-android": { + "extends": "base", + "distribution": "internal", "ios": { "autoIncrement": true, "buildArtifactPaths": ["ios/build/*"] @@ -86,16 +91,21 @@ }, "android": { "autoIncrement": true }, - "channel": "testflight", - "env": { - "EXPO_PUBLIC_ENV": "testflight" - } - }, - "sideload-android": { - "extends": "production", - "android": { - "buildType": "apk" - } + "channel": "testflight", + "env": { + "EXPO_PUBLIC_ENV": "testflight", + "SENTRY_DISABLE_AUTO_UPLOAD": "true" + } + }, + "sideload-android": { + "extends": "production", + "env": { + "EXPO_PUBLIC_ENV": "production", + "SENTRY_DISABLE_AUTO_UPLOAD": "true" + }, + "android": { + "buildType": "apk" + } } }, "submit": { diff --git a/package.json b/package.json --- a/package.json +++ b/package.json @@ -36,16 +36,16 @@ "postinstall": "pnpm intl:compile-if-needed", "prebuild": "EXPO_NO_GIT_STATUS=1 expo prebuild --clean", "windows-prebuild": "set EXPO_NO_GIT_STATUS=1&& expo prebuild --clean", "android": "expo run:android", - "android:prod": "expo run:android --variant release", - "android:profile": "BSKY_PROFILE=1 expo run:android --variant release", + "android:prod": "./scripts/runLocalAndroidProductionBuild.sh", + "android:profile": "BSKY_PROFILE=1 ./scripts/runLocalAndroidProductionBuild.sh", "ios": "expo run:ios", "web": "rspack serve", "use-build-number": "./scripts/useBuildNumberEnv.sh", "use-build-number-with-bump": "./scripts/useBuildNumberEnvWithBump.sh", "build-web": "NODE_ENV=production rspack build && node ./scripts/post-web-build.js", - "build-all": "pnpm intl:build && pnpm use-build-number-with-bump eas build --platform all", - "build-ios": "pnpm use-build-number-with-bump eas build -p ios", - "build-android": "pnpm use-build-number-with-bump eas build -p android", + "build-all": "pnpm intl:build && pnpm use-build-number-with-bump eas build --local --platform all", + "build-ios": "pnpm use-build-number-with-bump eas build --local -p ios", + "build-android": "pnpm use-build-number-with-bump eas build --local -p android", "build": "pnpm use-build-number-with-bump eas build", "build-embed": "cd bskyembed && pnpm build && pnpm build-snippet && cd .. && node ./scripts/post-embed-build.js", "start": "expo start --dev-client", @@ -128,7 +128,7 @@ "@react-native-async-storage/async-storage": "2.2.0", "@react-navigation/bottom-tabs": "^7.15.9", "@react-navigation/native": "^7.2.2", "@react-navigation/native-stack": "^7.14.11", - "@sentry/react-native": "~6.20.0", + "@sentry/react-native": "~7.0.1", "@tanstack/query-async-storage-persister": "^5.100.1", "@tanstack/react-query": "^5.100.1", "@tanstack/react-query-persist-client": "^5.100.1", diff --git a/patches/@sentry+react-native+6.20.0.patch.md b/patches/@sentry+react-native+6.20.0.patch.md --- a/patches/@sentry+react-native+6.20.0.patch.md +++ b/patches/@sentry+react-native+6.20.0.patch.md @@ -2,8 +2,6 @@ # @sentry/react-native/scripts/expo-upload-sourcemaps.js patch Lets us specify the output directory for the sourcemaps via an environment variable. -# @sentry/react-native/dist/js/tools/sentryMetroSerializer.js patch - -Patch of this: https://github.com/getsentry/sentry-react-native/issues/5180#issuecomment-3311772038 +# @sentry/react-native/dist/js/tools/utils.js patch -Will be fixed in an upcoming release of @sentry/react-native - remove when available. +Normalizes Metro's `countLines` export shape and falls back to a local implementation when needed. diff --git a/patches/@sentry__react-native.patch b/patches/@sentry__react-native.patch --- a/patches/@sentry__react-native.patch +++ b/patches/@sentry__react-native.patch @@ -1,31 +1,28 @@ -diff --git a/dist/js/tools/sentryMetroSerializer.js b/dist/js/tools/sentryMetroSerializer.js -index d7f2350..e9c0368 100644 ---- a/dist/js/tools/sentryMetroSerializer.js -+++ b/dist/js/tools/sentryMetroSerializer.js -@@ -12,12 +12,9 @@ exports.createSentryMetroSerializer = exports.unstable_beforeAssetSerializationP - const crypto = require("crypto"); - const utils_1 = require("./utils"); - const utils_2 = require("./vendor/metro/utils"); --let countLines; --try { -- countLines = require('metro/private/lib/countLines'); --} --catch (e) { -- countLines = require('metro/src/lib/countLines'); -+const newline = /\r\n?|\n|\u2028|\u2029/g; -+function countLines(string) { -+ return (string.match(newline) || []).length + 1; +diff --git a/dist/js/tools/utils.js b/dist/js/tools/utils.js +index 613e99e..121909f 100644 +--- a/dist/js/tools/utils.js ++++ b/dist/js/tools/utils.js +@@ -9,6 +9,12 @@ + catch (e) { + countLines = require('metro/src/lib/countLines'); } - const DEBUG_ID_PLACE_HOLDER = '__debug_id_place_holder__'; - const DEBUG_ID_MODULE_PATH = '__debugid__'; ++countLines = ++ typeof countLines === 'function' ++ ? countLines ++ : typeof countLines === 'object' && typeof countLines.default === 'function' ++ ? countLines.default ++ : (string) => (string.match(/\r\n?|\n|\u2028|\u2029/g) || []).length + 1; + /** + * Returns minified Debug ID code snippet. + */ diff --git a/scripts/expo-upload-sourcemaps.js b/scripts/expo-upload-sourcemaps.js -index b3783b5..d5e3e45 100755 +index 7003b53..d62c38a 100755 --- a/scripts/expo-upload-sourcemaps.js +++ b/scripts/expo-upload-sourcemaps.js @@ -218,7 +218,7 @@ for (const [assetGroupName, assets] of Object.entries(groupedAssets)) { const isHermes = assets.find(asset => asset.endsWith('.hbc')); - const windowsCallback = process.platform === "win32" ? 'node ' : ''; + const windowsCallback = process.platform === 'win32' ? 'node ' : ''; - execSync(`${windowsCallback}${sentryCliBin} sourcemaps upload ${isHermes ? '--debug-id-reference' : ''} ${assets.join(' ')}`, { + execSync(`${windowsCallback}${sentryCliBin} sourcemaps upload ${isHermes ? '--debug-id-reference' : ''} ${assets.join(' ')} --dist ${process.env.SENTRY_DIST}`, { env: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,7 +40,7 @@ '@discord/bottom-sheet': hash: c1f55b9e514f17d0fb14cb8f63be8c29c13813dc92825ad1b068319a89b78058 path: patches/@discord__bottom-sheet.patch '@sentry/react-native': - hash: eabe4ef5650ab873f0c4b4b4685b28674bb2bdfc5b6831d38a20cdbc65af8421 + hash: 852c6d9a331fb7116a58da70b0668c1b402dd7e7e32bc57c47122938e60a5cdb path: patches/@sentry__react-native.patch expo-font: hash: 8a2ed25637094fb1aabc6772b6da2b76d363506a3b1d35f467ce7c67602f31fa @@ -231,8 +231,8 @@ '@react-navigation/native-stack': specifier: ^7.14.11 version: 7.14.11(@react-navigation/native@7.2.2(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0))(react-native-safe-area-context@5.6.2(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0))(react-native-screens@4.24.0(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0) '@sentry/react-native': - specifier: ~6.20.0 - version: 6.20.0(patch_hash=eabe4ef5650ab873f0c4b4b4685b28674bb2bdfc5b6831d38a20cdbc65af8421)(expo@54.0.33(@babel/core@7.25.2)(react-native-webview@13.16.1(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0) + specifier: ~7.0.1 + version: 7.0.1(patch_hash=852c6d9a331fb7116a58da70b0668c1b402dd7e7e32bc57c47122938e60a5cdb)(expo@54.0.33(@babel/core@7.25.2)(react-native-webview@13.16.1(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0) '@tanstack/query-async-storage-persister': specifier: ^5.100.1 version: 5.100.1 @@ -4658,37 +4658,37 @@ '@rspack/lite-tapable@1.1.0': resolution: {integrity: sha512-E2B0JhYFmVAwdDiG14+DW0Di4Ze4Jg10Pc4/lILUrd5DRCaklduz2OvJ5HYQ6G+hd+WTzqQb3QnDNfK4yvAFYw==} - '@sentry-internal/browser-utils@8.55.0': - resolution: {integrity: sha512-ROgqtQfpH/82AQIpESPqPQe0UyWywKJsmVIqi3c5Fh+zkds5LUxnssTj3yNd1x+kxaPDVB023jAP+3ibNgeNDw==} - engines: {node: '>=14.18'} + '@sentry-internal/browser-utils@10.8.0': + resolution: {integrity: sha512-FaQX9eefc8sh3h3ZQy16U73KiH0xgDldXnrFiWK6OeWg8X4bJpnYbLqEi96LgHiQhjnnz+UQP1GDzH5oFuu5fA==} + engines: {node: '>=18'} - '@sentry-internal/feedback@8.55.0': - resolution: {integrity: sha512-cP3BD/Q6pquVQ+YL+rwCnorKuTXiS9KXW8HNKu4nmmBAyf7urjs+F6Hr1k9MXP5yQ8W3yK7jRWd09Yu6DHWOiw==} - engines: {node: '>=14.18'} + '@sentry-internal/feedback@10.8.0': + resolution: {integrity: sha512-n7SqgFQItq4QSPG7bCjcZcIwK6AatKnnmSDJ/i6e8jXNIyLwkEuY2NyvTXACxVdO/kafGD5VmrwnTo3Ekc1AMg==} + engines: {node: '>=18'} - '@sentry-internal/replay-canvas@8.55.0': - resolution: {integrity: sha512-nIkfgRWk1091zHdu4NbocQsxZF1rv1f7bbp3tTIlZYbrH62XVZosx5iHAuZG0Zc48AETLE7K4AX9VGjvQj8i9w==} - engines: {node: '>=14.18'} + '@sentry-internal/replay-canvas@10.8.0': + resolution: {integrity: sha512-jC4OOwiNgrlIPeXIPMLkaW53BSS1do+toYHoWzzO5AXGpN6jRhanoSj36FpVuH2N3kFnxKVfVxrwh8L+/3vFWg==} + engines: {node: '>=18'} - '@sentry-internal/replay@8.55.0': - resolution: {integrity: sha512-roCDEGkORwolxBn8xAKedybY+Jlefq3xYmgN2fr3BTnsXjSYOPC7D1/mYqINBat99nDtvgFvNfRcZPiwwZ1hSw==} - engines: {node: '>=14.18'} + '@sentry-internal/replay@10.8.0': + resolution: {integrity: sha512-9+qDEoEjv4VopLuOzK1zM4LcvcUsvB5N0iJ+FRCM3XzzOCbebJOniXTQbt5HflJc3XLnQNKFdKfTfgj8M/0RKQ==} + engines: {node: '>=18'} '@sentry/babel-plugin-component-annotate@3.6.1': resolution: {integrity: sha512-zmvUa4RpzDG3LQJFpGCE8lniz8Rk1Wa6ZvvK+yEH+snZeaHHRbSnAQBMR607GOClP+euGHNO2YtaY4UAdNTYbg==} engines: {node: '>= 14'} - '@sentry/babel-plugin-component-annotate@4.1.1': - resolution: {integrity: sha512-HUpqrCK7zDVojTV6KL6BO9ZZiYrEYQqvYQrscyMsq04z+WCupXaH6YEliiNRvreR8DBJgdsG3lBRpebhUGmvfA==} + '@sentry/babel-plugin-component-annotate@4.3.0': + resolution: {integrity: sha512-OuxqBprXRyhe8Pkfyz/4yHQJc5c3lm+TmYWSSx8u48g5yKewSQDOxkiLU5pAk3WnbLPy8XwU/PN+2BG0YFU9Nw==} engines: {node: '>= 14'} '@sentry/babel-plugin-component-annotate@5.2.0': resolution: {integrity: sha512-8LbOI5Kzb5F0+7LVQPi2+zGz1iPiRRFhM+7uZ/ZQ33L9BmDOYNIy3xWxCfMw2JCuMXXaxF47XCjGmR22/B0WPg==} engines: {node: '>= 18'} - '@sentry/browser@8.55.0': - resolution: {integrity: sha512-1A31mCEWCjaMxJt6qGUK+aDnLDcK6AwLAZnqpSchNysGni1pSn1RWSmk9TBF8qyTds5FH8B31H480uxMPUJ7Cw==} - engines: {node: '>=14.18'} + '@sentry/browser@10.8.0': + resolution: {integrity: sha512-2J7HST8/ixCaboq17yFn/j/OEokXSXoCBMXRrFx4FKJggKWZ90e2Iau5mP/IPPhrW+W9zCptCgNMY0167wS4qA==} + engines: {node: '>=18'} '@sentry/bundler-plugin-core@3.6.1': resolution: {integrity: sha512-/ubWjPwgLep84sUPzHfKL2Ns9mK9aQrEX4aBFztru7ygiJidKJTxYGtvjh4dL2M1aZ0WRQYp+7PF6+VKwdZXcQ==} @@ -4698,8 +4698,8 @@ '@sentry/bundler-plugin-core@5.2.0': resolution: {integrity: sha512-+C0x4gEIJRgoMwyRFGx+TFiJ1Po2BZlT1v61+PnouiaprKL5qtZG8n5PXx/5LPLDsVjSIcXjnDrTz9aSm8SJ3w==} engines: {node: '>= 18'} - '@sentry/cli-darwin@2.51.1': - resolution: {integrity: sha512-R1u8IQdn/7Rr8sf6bVVr0vJT4OqwCFdYsS44Y3OoWGVJW2aAQTWRJOTlV4ueclVLAyUQzmgBjfR8AtiUhd/M5w==} + '@sentry/cli-darwin@2.53.0': + resolution: {integrity: sha512-NNPfpILMwKgpHiyJubHHuauMKltkrgLQ5tvMdxNpxY60jBNdo5VJtpESp4XmXlnidzV4j1z61V4ozU6ttDgt5Q==} engines: {node: '>=10'} os: [darwin] @@ -4708,8 +4708,8 @@ resolution: {integrity: sha512-lYrNzenZFJftfwSya7gwrHGxtE+Kob/e1sr9lmHMFOd4utDlmq0XFDllmdZAMf21fxcPRI1GL28ejZ3bId01fQ==} engines: {node: '>=10'} os: [darwin] - '@sentry/cli-linux-arm64@2.51.1': - resolution: {integrity: sha512-nvA/hdhsw4bKLhslgbBqqvETjXwN1FVmwHLOrRvRcejDO6zeIKUElDiL5UOjGG0NC+62AxyNw5ri8Wzp/7rg9Q==} + '@sentry/cli-linux-arm64@2.53.0': + resolution: {integrity: sha512-xY/CZ1dVazsSCvTXzKpAgXaRqfljVfdrFaYZRUaRPf1ZJRGa3dcrivoOhSIeG/p5NdYtMvslMPY9Gm2MT0M83A==} engines: {node: '>=10'} cpu: [arm64] os: [linux, freebsd, android] @@ -4720,8 +4720,8 @@ engines: {node: '>=10'} cpu: [arm64] os: [linux, freebsd, android] - '@sentry/cli-linux-arm@2.51.1': - resolution: {integrity: sha512-Klro17OmSSKOOSaxVKBBNPXet2+HrIDZUTSp8NRl4LQsIubdc1S/aQ79cH/g52Muwzpl3aFwPxyXw+46isfEgA==} + '@sentry/cli-linux-arm@2.53.0': + resolution: {integrity: sha512-NdRzQ15Ht83qG0/Lyu11ciy/Hu/oXbbtJUgwzACc7bWvHQA8xEwTsehWexqn1529Kfc5EjuZ0Wmj3MHmp+jOWw==} engines: {node: '>=10'} cpu: [arm] os: [linux, freebsd, android] @@ -4732,8 +4732,8 @@ engines: {node: '>=10'} cpu: [arm] os: [linux, freebsd, android] - '@sentry/cli-linux-i686@2.51.1': - resolution: {integrity: sha512-jp4TmR8VXBdT9dLo6mHniQHN0xKnmJoPGVz9h9VDvO2Vp/8o96rBc555D4Am5wJOXmfuPlyjGcmwHlB3+kQRWw==} + '@sentry/cli-linux-i686@2.53.0': + resolution: {integrity: sha512-0REmBibGAB4jtqt9S6JEsFF4QybzcXHPcHtJjgMi5T0ueh952uG9wLzjSxQErCsxTKF+fL8oG0Oz5yKBuCwCCQ==} engines: {node: '>=10'} cpu: [x86, ia32] os: [linux, freebsd, android] @@ -4744,8 +4744,8 @@ engines: {node: '>=10'} cpu: [x86, ia32] os: [linux, freebsd, android] - '@sentry/cli-linux-x64@2.51.1': - resolution: {integrity: sha512-JuLt0MXM2KHNFmjqXjv23sly56mJmUQzGBWktkpY3r+jE08f5NLKPd5wQ6W/SoLXGIOKnwLz0WoUg7aBVyQdeQ==} + '@sentry/cli-linux-x64@2.53.0': + resolution: {integrity: sha512-9UGJL+Vy5N/YL1EWPZ/dyXLkShlNaDNrzxx4G7mTS9ywjg+BIuemo6rnN7w43K1NOjObTVO6zY0FwumJ1pCyLg==} engines: {node: '>=10'} cpu: [x64] os: [linux, freebsd, android] @@ -4756,8 +4756,8 @@ engines: {node: '>=10'} cpu: [x64] os: [linux, freebsd, android] - '@sentry/cli-win32-arm64@2.51.1': - resolution: {integrity: sha512-PiwjTdIFDazTQCTyDCutiSkt4omggYSKnO3HE1+LDjElsFrWY9pJs4fU3D40WAyE2oKu0MarjNH/WxYGdqEAlg==} + '@sentry/cli-win32-arm64@2.53.0': + resolution: {integrity: sha512-G1kjOjrjMBY20rQcJV2GA8KQE74ufmROCDb2GXYRfjvb1fKAsm4Oh8N5+Tqi7xEHdjQoLPkE4CNW0aH68JSUDQ==} engines: {node: '>=10'} cpu: [arm64] os: [win32] @@ -4768,8 +4768,8 @@ engines: {node: '>=10'} cpu: [arm64] os: [win32] - '@sentry/cli-win32-i686@2.51.1': - resolution: {integrity: sha512-TMvZZpeiI2HmrDFNVQ0uOiTuYKvjEGOZdmUxe3WlhZW82A/2Oka7sQ24ljcOovbmBOj5+fjCHRUMYvLMCWiysA==} + '@sentry/cli-win32-i686@2.53.0': + resolution: {integrity: sha512-qbGTZUzesuUaPtY9rPXdNfwLqOZKXrJRC1zUFn52hdo6B+Dmv0m/AHwRVFHZP53Tg1NCa8bDei2K/uzRN0dUZw==} engines: {node: '>=10'} cpu: [x86, ia32] os: [win32] @@ -4780,8 +4780,8 @@ engines: {node: '>=10'} cpu: [x86, ia32] os: [win32] - '@sentry/cli-win32-x64@2.51.1': - resolution: {integrity: sha512-v2hreYUPPTNK1/N7+DeX7XBN/zb7p539k+2Osf0HFyVBaoUC3Y3+KBwSf4ASsnmgTAK7HCGR+X0NH1vP+icw4w==} + '@sentry/cli-win32-x64@2.53.0': + resolution: {integrity: sha512-1TXYxYHtwgUq5KAJt3erRzzUtPqg7BlH9T7MdSPHjJatkrr/kwZqnVe2H6Arr/5NH891vOlIeSPHBdgJUAD69g==} engines: {node: '>=10'} cpu: [x64] os: [win32] @@ -4792,8 +4792,8 @@ engines: {node: '>=10'} cpu: [x64] os: [win32] - '@sentry/cli@2.51.1': - resolution: {integrity: sha512-FU+54kNcKJABU0+ekvtnoXHM9zVrDe1zXVFbQT7mS0On0m1P0zFRGdzbnWe2XzpzuEAJXtK6aog/W+esRU9AIA==} + '@sentry/cli@2.53.0': + resolution: {integrity: sha512-n2ZNb+5Z6AZKQSI0SusQ7ZzFL637mfw3Xh4C3PEyVSn9LiF683fX0TTq8OeGmNZQS4maYfS95IFD+XpydU0dEA==} engines: {node: '>= 10'} hasBin: true @@ -4802,12 +4802,12 @@ resolution: {integrity: sha512-tavJ7yGUZV+z3Ct2/ZB6mg339i08sAk6HDkgqmSRuQEu2iLS5sl9HIvuXfM6xjv8fwlgFOSy++WNABNAcGHUbg==} engines: {node: '>= 10'} hasBin: true - '@sentry/core@8.55.0': - resolution: {integrity: sha512-6g7jpbefjHYs821Z+EBJ8r4Z7LT5h80YSWRJaylGS4nW5W5Z2KXzpdnyFarv37O7QjauzVC2E+PABmpkw5/JGA==} - engines: {node: '>=14.18'} + '@sentry/core@10.8.0': + resolution: {integrity: sha512-scYzM/UOItu4PjEq6CpHLdArpXjIS0laHYxE4YjkIbYIH6VMcXGQbD/FSBClsnCr1wXRnlXfXBzj0hrQAFyw+Q==} + engines: {node: '>=18'} - '@sentry/react-native@6.20.0': - resolution: {integrity: sha512-YngSba14Hsb5t/ZNMOyxb/HInmYRL5pQ74BkoMBQ/UBBM5kWHgSILxoO2XkKYtaaJXrkSJj+kBalELHblz9h5g==} + '@sentry/react-native@7.0.1': + resolution: {integrity: sha512-xz8ON51qSDvcHVFkdLo0b7rlrQVXpRVXqzm7e1+nHEZ07TX0o+utxx04akxD1Z4hmGPTWPmsHeMlm7diV9NtTQ==} hasBin: true peerDependencies: expo: '>=49.0.0' @@ -4817,9 +4817,9 @@ peerDependenciesMeta: expo: optional: true - '@sentry/react@8.55.0': - resolution: {integrity: sha512-/qNBvFLpvSa/Rmia0jpKfJdy16d4YZaAnH/TuKLAtm0BWlsPQzbXCU4h8C5Hsst0Do0zG613MEtEmWpWrVOqWA==} - engines: {node: '>=14.18'} + '@sentry/react@10.8.0': + resolution: {integrity: sha512-w/dGLMCLJG2lp8gKVKX1jjeg2inXewKfPb73+PS1CDi9/ihvqZU2DAXxnaNsBA7YYtGwlWVJe1bLAqguwTEpqw==} + engines: {node: '>=18'} peerDependencies: react: ^16.14.0 || 17.x || 18.x || 19.x @@ -4832,13 +4832,9 @@ peerDependenciesMeta: rollup: optional: true - '@sentry/types@8.55.0': - resolution: {integrity: sha512-6LRT0+r6NWQ+RtllrUW2yQfodST0cJnkOmdpHA75vONgBUhpKwiJ4H7AmgfoTET8w29pU6AnntaGOe0LJbOmog==} - engines: {node: '>=14.18'} - - '@sentry/utils@8.55.0': - resolution: {integrity: sha512-cYcl39+xcOivBpN9d8ZKbALl+DxZKo/8H0nueJZ0PO4JA+MJGhSm6oHakXxLPaiMoNLTX7yor8ndnQIuFg+vmQ==} - engines: {node: '>=14.18'} + '@sentry/types@10.8.0': + resolution: {integrity: sha512-xRe41/KvnNt4o6t5YeB+yBRTWvLUu6FJpft/VBOs4Bfh1/6rz+l78oxSCtpXo3MsfTd5185I0uuggAjEdD4Y6g==} + engines: {node: '>=18'} '@sentry/vite-plugin@5.2.0': resolution: {integrity: sha512-4Jo3ixBspso5HY81PDvZdRXkH9wYGVmcw/0a2IX9ejbyKBdHqkYg4IhAtNqGUAyGuHwwRS9Y1S+sCMvrXv6htw==} @@ -17832,37 +17828,37 @@ '@rspack/dev-middleware': 2.0.1(@rspack/core@2.0.0) '@rspack/lite-tapable@1.1.0': {} - '@sentry-internal/browser-utils@8.55.0': + '@sentry-internal/browser-utils@10.8.0': dependencies: - '@sentry/core': 8.55.0 + '@sentry/core': 10.8.0 - '@sentry-internal/feedback@8.55.0': + '@sentry-internal/feedback@10.8.0': dependencies: - '@sentry/core': 8.55.0 + '@sentry/core': 10.8.0 - '@sentry-internal/replay-canvas@8.55.0': + '@sentry-internal/replay-canvas@10.8.0': dependencies: - '@sentry-internal/replay': 8.55.0 - '@sentry/core': 8.55.0 + '@sentry-internal/replay': 10.8.0 + '@sentry/core': 10.8.0 - '@sentry-internal/replay@8.55.0': + '@sentry-internal/replay@10.8.0': dependencies: - '@sentry-internal/browser-utils': 8.55.0 - '@sentry/core': 8.55.0 + '@sentry-internal/browser-utils': 10.8.0 + '@sentry/core': 10.8.0 '@sentry/babel-plugin-component-annotate@3.6.1': {} - '@sentry/babel-plugin-component-annotate@4.1.1': {} + '@sentry/babel-plugin-component-annotate@4.3.0': {} '@sentry/babel-plugin-component-annotate@5.2.0': {} - '@sentry/browser@8.55.0': + '@sentry/browser@10.8.0': dependencies: - '@sentry-internal/browser-utils': 8.55.0 - '@sentry-internal/feedback': 8.55.0 - '@sentry-internal/replay': 8.55.0 - '@sentry-internal/replay-canvas': 8.55.0 - '@sentry/core': 8.55.0 + '@sentry-internal/browser-utils': 10.8.0 + '@sentry-internal/feedback': 10.8.0 + '@sentry-internal/replay': 10.8.0 + '@sentry-internal/replay-canvas': 10.8.0 + '@sentry/core': 10.8.0 '@sentry/bundler-plugin-core@3.6.1': dependencies: @@ -17891,55 +17887,55 @@ transitivePeerDependencies: - encoding - supports-color - '@sentry/cli-darwin@2.51.1': + '@sentry/cli-darwin@2.53.0': optional: true '@sentry/cli-darwin@2.58.5': optional: true - '@sentry/cli-linux-arm64@2.51.1': + '@sentry/cli-linux-arm64@2.53.0': optional: true '@sentry/cli-linux-arm64@2.58.5': optional: true - '@sentry/cli-linux-arm@2.51.1': + '@sentry/cli-linux-arm@2.53.0': optional: true '@sentry/cli-linux-arm@2.58.5': optional: true - '@sentry/cli-linux-i686@2.51.1': + '@sentry/cli-linux-i686@2.53.0': optional: true '@sentry/cli-linux-i686@2.58.5': optional: true - '@sentry/cli-linux-x64@2.51.1': + '@sentry/cli-linux-x64@2.53.0': optional: true '@sentry/cli-linux-x64@2.58.5': optional: true - '@sentry/cli-win32-arm64@2.51.1': + '@sentry/cli-win32-arm64@2.53.0': optional: true '@sentry/cli-win32-arm64@2.58.5': optional: true - '@sentry/cli-win32-i686@2.51.1': + '@sentry/cli-win32-i686@2.53.0': optional: true '@sentry/cli-win32-i686@2.58.5': optional: true - '@sentry/cli-win32-x64@2.51.1': + '@sentry/cli-win32-x64@2.53.0': optional: true '@sentry/cli-win32-x64@2.58.5': optional: true - '@sentry/cli@2.51.1': + '@sentry/cli@2.53.0': dependencies: https-proxy-agent: 5.0.1 node-fetch: 2.7.0 @@ -17947,14 +17943,14 @@ progress: 2.0.3 proxy-from-env: 1.1.0 which: 2.0.2 optionalDependencies: - '@sentry/cli-darwin': 2.51.1 - '@sentry/cli-linux-arm': 2.51.1 - '@sentry/cli-linux-arm64': 2.51.1 - '@sentry/cli-linux-i686': 2.51.1 - '@sentry/cli-linux-x64': 2.51.1 - '@sentry/cli-win32-arm64': 2.51.1 - '@sentry/cli-win32-i686': 2.51.1 - '@sentry/cli-win32-x64': 2.51.1 + '@sentry/cli-darwin': 2.53.0 + '@sentry/cli-linux-arm': 2.53.0 + '@sentry/cli-linux-arm64': 2.53.0 + '@sentry/cli-linux-i686': 2.53.0 + '@sentry/cli-linux-x64': 2.53.0 + '@sentry/cli-win32-arm64': 2.53.0 + '@sentry/cli-win32-i686': 2.53.0 + '@sentry/cli-win32-x64': 2.53.0 transitivePeerDependencies: - encoding - supports-color @@ -17979,17 +17975,16 @@ transitivePeerDependencies: - encoding - supports-color - '@sentry/core@8.55.0': {} + '@sentry/core@10.8.0': {} - '@sentry/react-native@6.20.0(patch_hash=eabe4ef5650ab873f0c4b4b4685b28674bb2bdfc5b6831d38a20cdbc65af8421)(expo@54.0.33(@babel/core@7.25.2)(react-native-webview@13.16.1(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0)': + '@sentry/react-native@7.0.1(patch_hash=852c6d9a331fb7116a58da70b0668c1b402dd7e7e32bc57c47122938e60a5cdb)(expo@54.0.33(@babel/core@7.25.2)(react-native-webview@13.16.1(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0)': dependencies: - '@sentry/babel-plugin-component-annotate': 4.1.1 - '@sentry/browser': 8.55.0 - '@sentry/cli': 2.51.1 - '@sentry/core': 8.55.0 - '@sentry/react': 8.55.0(react@19.1.0) - '@sentry/types': 8.55.0 - '@sentry/utils': 8.55.0 + '@sentry/babel-plugin-component-annotate': 4.3.0 + '@sentry/browser': 10.8.0 + '@sentry/cli': 2.53.0 + '@sentry/core': 10.8.0 + '@sentry/react': 10.8.0(react@19.1.0) + '@sentry/types': 10.8.0 react: 19.1.0 react-native: 0.81.5(patch_hash=1708bf9fa9265ebd463d53fa71c037e9387eb16fb483287e49616407b4dc342e)(@babel/core@7.25.2)(@types/react@19.2.14)(react@19.1.0) optionalDependencies: @@ -17998,10 +17993,10 @@ transitivePeerDependencies: - encoding - supports-color - '@sentry/react@8.55.0(react@19.1.0)': + '@sentry/react@10.8.0(react@19.1.0)': dependencies: - '@sentry/browser': 8.55.0 - '@sentry/core': 8.55.0 + '@sentry/browser': 10.8.0 + '@sentry/core': 10.8.0 hoist-non-react-statics: 3.3.2 react: 19.1.0 @@ -18015,13 +18010,9 @@ transitivePeerDependencies: - encoding - supports-color - '@sentry/types@8.55.0': - dependencies: - '@sentry/core': 8.55.0 - - '@sentry/utils@8.55.0': + '@sentry/types@10.8.0': dependencies: - '@sentry/core': 8.55.0 + '@sentry/core': 10.8.0 '@sentry/vite-plugin@5.2.0(rollup@4.60.2)': dependencies: diff --git a/scripts/runLocalAndroidProductionBuild.sh b/scripts/runLocalAndroidProductionBuild.sh new file mode 100644 --- /dev/null +++ b/scripts/runLocalAndroidProductionBuild.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail + +release_version=$(jq -r '.version' package.json) +bundle_identifier=$(git rev-parse HEAD) +bundle_date=$(date -u +"%y%m%d%H") + +if [[ -z "${SENTRY_AUTH_TOKEN:-}" ]]; then + export SENTRY_DISABLE_AUTO_UPLOAD=true +fi + +EXPO_PUBLIC_RELEASE_VERSION="$release_version" \ +EXPO_PUBLIC_BUNDLE_IDENTIFIER="$bundle_identifier" \ +EXPO_PUBLIC_BUNDLE_DATE="$bundle_date" \ +pnpm use-build-number-with-bump expo run:android --variant release "$@" diff --git a/src/analytics/metrics/client.test.ts b/src/analytics/metrics/client.test.ts --- a/src/analytics/metrics/client.test.ts +++ b/src/analytics/metrics/client.test.ts @@ -1,7 +1,7 @@ import {MetricsClient} from './client' let appStateCallback: (state: string) => void -const mockCaptureMessage = jest.fn() +const mockSentryLogInfo = jest.fn() let mockMetricsApiHost: string | undefined = 'https://test.metrics.api' let mockSentryDsn: string | undefined @@ -24,7 +24,9 @@ }, })) jest.mock('@sentry/react-native', () => ({ - captureMessage: mockCaptureMessage, + logger: { + info: mockSentryLogInfo, + }, })) jest.mock('#/env', () => ({ @@ -63,7 +65,7 @@ beforeEach(() => { jest.useFakeTimers({advanceTimers: true}) mockMetricsApiHost = 'https://test.metrics.api' mockSentryDsn = undefined - mockCaptureMessage.mockReset() + mockSentryLogInfo.mockReset() fetchRequests = [] fetchMock = jest.fn().mockImplementation((_url, options?: RequestInit) => { const body = parseFetchBody(options) @@ -213,21 +215,15 @@ await jest.advanceTimersByTimeAsync(10_000) expect(fetchRequests).toHaveLength(0) - expect(mockCaptureMessage).toHaveBeenCalledTimes(2) - expect(mockCaptureMessage).toHaveBeenNthCalledWith( + expect(mockSentryLogInfo).toHaveBeenCalledTimes(2) + expect(mockSentryLogInfo).toHaveBeenNthCalledWith( 1, 'metric:click', expect.objectContaining({ - level: 'info', - fingerprint: ['metric', 'click'], - tags: expect.objectContaining({ - metric_name: 'click', - metric_source: 'app', - }), - extra: expect.objectContaining({ - logger: 'metric', - payload: {button: 'submit'}, - }), + logger: 'metric', + metric_name: 'click', + metric_source: 'app', + payload: {button: 'submit'}, }), ) }) diff --git a/src/analytics/metrics/client.ts b/src/analytics/metrics/client.ts --- a/src/analytics/metrics/client.ts +++ b/src/analytics/metrics/client.ts @@ -133,19 +133,13 @@ } private sendBatchToSentry(events: Event[]) { for (const event of events) { - Sentry.captureMessage(`metric:${String(event.event)}`, { - level: 'info', - fingerprint: ['metric', String(event.event)], - tags: { - metric_name: String(event.event), - metric_source: event.source, - }, - extra: { - logger: 'metric', - eventTime: event.time, - payload: event.payload, - metadata: event.metadata, - }, + Sentry.logger.info(`metric:${String(event.event)}`, { + logger: 'metric', + metric_name: String(event.event), + metric_source: event.source, + event_time: event.time, + payload: event.payload, + metadata: event.metadata, }) } } diff --git a/src/logger/sentry/setup/index.ts b/src/logger/sentry/setup/index.ts --- a/src/logger/sentry/setup/index.ts +++ b/src/logger/sentry/setup/index.ts @@ -10,6 +10,9 @@ 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 environment: env.ENV, dist: env.BUNDLE_IDENTIFIER, release: env.RELEASE_VERSION, + enableLogs: true, + enableAutoPerformanceTracing: true, + tracesSampleRate: env.IS_INTERNAL ? 1.0 : 0.05, ignoreErrors: [ /* * Unknown internals errors