Skip to content

Commit

Permalink
feat: add mobile app release version in Sentry issues (#3249)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniruddha-Shriwant committed Nov 5, 2024
1 parent d9b879e commit 6e6885d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"env": {
"es6": true
},
"root": true,
"ignorePatterns": [
"projects/**/*",
Expand Down
4 changes: 2 additions & 2 deletions hooks/prebuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);

Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
});

Expand Down

0 comments on commit 6e6885d

Please sign in to comment.