Merge pull request #773 from ente-io/fix-uncaught-expection-missing-user-id

fix-uncaught-expection-missing-user id
This commit is contained in:
Abhinav Kumar 2022-11-17 15:18:55 +05:30 committed by GitHub
commit 1b45b8447b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -13,7 +13,6 @@ const SENTRY_ENV = getSentryENV();
const SENTRY_RELEASE = getSentryRelease();
const IS_ENABLED = getIsSentryEnabled();
Sentry.setUser({ id: getSentryUserID() });
Sentry.init({
dsn: SENTRY_DSN,
enabled: IS_ENABLED,
@ -39,3 +38,9 @@ Sentry.init({
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
// that it will also get attached to your source maps
});
const main = async () => {
Sentry.setUser({ id: await getSentryUserID() });
};
main();

View file

@ -6,6 +6,8 @@ import {
getIsSentryEnabled,
} from 'constants/sentry';
import { getSentryUserID } from 'utils/user';
const SENTRY_DSN = getSentryDSN();
const SENTRY_ENV = getSentryENV();
const SENTRY_RELEASE = getSentryRelease();
@ -18,3 +20,9 @@ Sentry.init({
release: SENTRY_RELEASE,
autoSessionTracking: false,
});
const main = async () => {
Sentry.setUser({ id: await getSentryUserID() });
};
main();