From 6e6885df60f72a13cc352884126fe5fa256fd1d3 Mon Sep 17 00:00:00 2001 From: Aniruddha Shriwant Date: Tue, 5 Nov 2024 15:41:00 +0530 Subject: [PATCH] feat: add mobile app release version in Sentry issues (#3249) --- .eslintrc.json | 3 +++ hooks/prebuild.js | 4 ++-- src/main.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index badf9bfd81..9f17a27704 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,4 +1,7 @@ { + "env": { + "es6": true + }, "root": true, "ignorePatterns": [ "projects/**/*", diff --git a/hooks/prebuild.js b/hooks/prebuild.js index 64f8141423..3e143a0f2f 100644 --- a/hooks/prebuild.js +++ b/hooks/prebuild.js @@ -46,12 +46,12 @@ module.exports = function (ctx) { '/node_modules/@capacitor-community/camera-preview/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java', }; - // Adding GIT_COMMIT_SHA for sentry + // Adding mobile app version for tracking the release in sentry var mainPath = path.resolve(process.cwd(), 'src/main.ts'); var mainPathContent = fs.readFileSync(mainPath).toString(); fs.writeFileSync( mainPath, - mainPathContent.replace(/please-replace-your-git-commit-version/g, process.env.CI_GIT_COMMIT_SHA), + mainPathContent.replace(/please-replace-your-mobile-app-version/g, ctx.env.FYLE_MOBILE_RELEASE_VERSION), 'utf8' ); diff --git a/src/main.ts b/src/main.ts index c34b67b455..fd7fdc3a55 100644 --- a/src/main.ts +++ b/src/main.ts @@ -18,7 +18,7 @@ Sentry.init({ dsn: environment.SENTRY_DSN, integrations: [], tracesSampleRate: 0.1, - release: 'please-replace-your-git-commit-version', + release: 'please-replace-your-mobile-app-version', ignoreErrors: ['Non-Error exception captured', 'Non-Error promise rejection captured'], });