Skip to content

Commit

Permalink
fix(www): always send the build number as a tag to Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Oct 6, 2023
1 parent 813fbba commit fb9b69c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/www/app/cordova_main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import * as Sentry from '@sentry/browser';

import {AbstractClipboard} from './clipboard';
import {EnvironmentVariables} from './environment';
import {SentryErrorReporter} from '../shared/error_reporter';
import {SentryErrorReporter, Tags} from '../shared/error_reporter';
import {main} from './main';
import * as errors from '../model/errors';
import {OutlinePlatform} from './platform';
Expand Down Expand Up @@ -70,8 +70,8 @@ async function pluginExecWithErrorCode<T>(cmd: string, ...args: unknown[]): Prom

// Adds reports from the (native) Cordova plugin.
class CordovaErrorReporter extends SentryErrorReporter {
constructor(appVersion: string, appBuildNumber: string, dsn: string) {
super(appVersion, dsn, {'build.number': appBuildNumber});
constructor(appVersion: string, dsn: string, tags: Tags) {
super(appVersion, dsn, tags);
// Initializes the error reporting framework with the supplied credentials.
// TODO(fortuna): This is an Promise that is not waited for and can cause a race condition.
// We should fix it with an async factory function for the Reporter.
Expand Down Expand Up @@ -145,8 +145,8 @@ class CordovaPlatform implements OutlinePlatform {

getErrorReporter(env: EnvironmentVariables) {
return this.hasDeviceSupport()
? new CordovaErrorReporter(env.APP_VERSION, env.APP_BUILD_NUMBER, env.SENTRY_DSN || '')
: new SentryErrorReporter(env.APP_VERSION, env.SENTRY_DSN || '', {});
? new CordovaErrorReporter(env.APP_VERSION, env.SENTRY_DSN || '', {'build.number': env.APP_BUILD_NUMBER})
: new SentryErrorReporter(env.APP_VERSION, env.SENTRY_DSN || '', {'build.number': env.APP_BUILD_NUMBER});
}

getUpdater() {
Expand Down

0 comments on commit fb9b69c

Please sign in to comment.