Sentry uses RELEASE from webpack to correspond with sourcemap uploader (#6996)

use RELEASE from webpack to correspond with sourcemap uploader
This commit is contained in:
James Salter 2021-10-20 17:20:50 +01:00 committed by GitHub
parent 7c50cfeab8
commit 115c6e8357
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,6 @@ limitations under the License.
*/ */
import * as Sentry from "@sentry/browser"; import * as Sentry from "@sentry/browser";
import PlatformPeg from "./PlatformPeg";
import SdkConfig from "./SdkConfig"; import SdkConfig from "./SdkConfig";
import { MatrixClientPeg } from "./MatrixClientPeg"; import { MatrixClientPeg } from "./MatrixClientPeg";
import SettingsStore from "./settings/SettingsStore"; import SettingsStore from "./settings/SettingsStore";
@ -200,15 +199,9 @@ interface ISentryConfig {
export async function initSentry(sentryConfig: ISentryConfig): Promise<void> { export async function initSentry(sentryConfig: ISentryConfig): Promise<void> {
if (!sentryConfig) return; if (!sentryConfig) return;
const platform = PlatformPeg.get();
let appVersion = "unknown";
try {
appVersion = await platform.getAppVersion();
} catch (e) {}
Sentry.init({ Sentry.init({
dsn: sentryConfig.dsn, dsn: sentryConfig.dsn,
release: `${platform.getHumanReadableName()}@${appVersion}`, release: process.env.RELEASE,
environment: sentryConfig.environment, environment: sentryConfig.environment,
defaultIntegrations: false, defaultIntegrations: false,
autoSessionTracking: false, autoSessionTracking: false,