1286 lines
59 KiB
TypeScript
1286 lines
59 KiB
TypeScript
/* Metro module 1217; source: modules/errors/native/SentryInitUtils.tsx; dependencies: [5, 27, 661, 482, 819, 3, 1218, 1230, 683, 12842, 4826, 4831, 12843, 1216, 1582, 4827, 477, 4092, 5256, 658, 4020, 2] */
|
||
function _fun13539(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#13539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:6, offset: 0x00dede8e, size: 654 bytes, params: 8, frame: 26
|
||
const env0_0 = require;
|
||
const sample = function(a0) {
|
||
var Math = global.Math;
|
||
return Math.random() <= a0;
|
||
};
|
||
const getStringExtra = function(a0) {
|
||
var value = a0;
|
||
var value2 = null;
|
||
return typeof value !== 'string' ? value2 : value.length > 0 ? value : value2;
|
||
};
|
||
const Object = global.Object;
|
||
Object.defineProperty(exports, '__esModule', {value: true});
|
||
const env0_4 = importDefault(5) /* metro dependency 5 */;
|
||
const env0_5 = (require(27) /* metro dependency 27 */).NativeModules;
|
||
let value = require(661) /* metro dependency 661: Constants */;
|
||
const env0_6 = value.AnalyticEvents;
|
||
const Endpoints = value.Endpoints;
|
||
const env0_7 = (require(482) /* metro dependency 482: Constants */).PRIMARY_DOMAIN;
|
||
value = require(819) /* metro dependency 819 */;
|
||
value = value.reactNavigationIntegration();
|
||
let RegExp = global.RegExp;
|
||
let GLOBAL_ENV = global.window.GLOBAL_ENV;
|
||
let API_VERSION = GLOBAL_ENV.API_VERSION;
|
||
const METRICS = Endpoints.METRICS;
|
||
let value2 = '/v' + API_VERSION + METRICS;
|
||
const value3 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
||
let regExp = new RegExp(value2, 'g');
|
||
items = [regExp instanceof Object ? regExp : value3];
|
||
RegExp = global.RegExp;
|
||
GLOBAL_ENV = global.window.GLOBAL_ENV;
|
||
API_VERSION = GLOBAL_ENV.API_VERSION;
|
||
const METRICS_V2 = Endpoints.METRICS_V2;
|
||
const value5 = '/v' + API_VERSION + METRICS_V2;
|
||
const value6 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
||
regExp = new RegExp(value5, 'g');
|
||
items[1] = regExp instanceof Object ? regExp : value6;
|
||
RegExp = global.RegExp;
|
||
GLOBAL_ENV = global.window.GLOBAL_ENV;
|
||
API_VERSION = GLOBAL_ENV.API_VERSION;
|
||
const TRACK = Endpoints.TRACK;
|
||
const value8 = '/v' + API_VERSION + TRACK;
|
||
const value9 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
||
regExp = new RegExp(value8, 'g');
|
||
items[2] = regExp instanceof Object ? regExp : value9;
|
||
const value13 = new (importDefault(3) /* metro dependency 3: Logger */)('Sentry');
|
||
const env0_11 = ['The operation couldn’t be completed. (com.apple.CallKit.error.requesttransaction',
|
||
'Request has been terminated', "couldn't execute statement: database is disabled",
|
||
"couldn't delete database: database is currently open", 'database is no longer open'];
|
||
const env0_14 = (require(12843) /* metro dependency 12843: CommonSentryInitUtils */).filterThrottle({'maxBudgetMinute': 1,
|
||
'maxBudgetHour': 15});
|
||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/errors/native/SentryInitUtils.tsx');
|
||
exports.routingInstrumentation = value;
|
||
exports.initSentry = function() {
|
||
var CrashReportingManager = NativeModules.CrashReportingManager;
|
||
if (CrashReportingManager != null) {
|
||
CrashReportingManager.getIsUserStaffForCrashReporting(_fun13560);
|
||
}
|
||
};
|
||
}
|
||
|
||
function _maybeBackfillMissingBreadcrumbsFromTelemetryRing() { // fn#13540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:727, offset: 0x00dee11c, size: 48 bytes, params: 1, frame: 14
|
||
return env0_4(_fun13542).apply(this, arguments);
|
||
}
|
||
|
||
function filterError(a0, a1) { // fn#13547, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:1345, offset: 0x00dee304, size: 374 bytes, params: 3, frame: 19
|
||
var tags;
|
||
const env0_0 = a0;
|
||
const env0_1 = a1;
|
||
const value = null;
|
||
const value2 = undefined;
|
||
let originalException = value == a1 ? value2 : a1.originalException;
|
||
let status = value == originalException ? value2 : originalException.status;
|
||
let r4 = (status && status >= 400 || (value != (value == originalException ? value2 : originalException.captchaFields) ? value == originalException ? value2 : originalException.code : value) && (value != (value == originalException ? value2 : originalException.captchaFields) ? value == originalException ? value2 : originalException.code : value) < 0) && true;
|
||
if (!r4) {
|
||
originalException = value == a1 ? value2 : a1.originalException;
|
||
r4 = !((value == originalException || value == originalException.err ? value2 : originalException.err.code) !== 'ABORTED') && true;
|
||
}
|
||
if (r4) {
|
||
markCrashHandled_13557(a0.event_id);
|
||
} else {
|
||
originalException = value == a1 ? value2 : a1.originalException;
|
||
status = value == originalException ? value2 : originalException.status;
|
||
if (value != status) {
|
||
tags = a0.tags;
|
||
if (value == tags) {
|
||
a0.tags = {};
|
||
}
|
||
tags = a0.tags;
|
||
tags.httpStatusCode = status;
|
||
}
|
||
var r7 = a0.level !== 'error' ? env0_12 : 0.005;
|
||
if (env0_13) {
|
||
return env0_4(_fun13549)();
|
||
}
|
||
if (env0_14()) {
|
||
if (sample(r7)) {
|
||
return env0_4(_fun13549)();
|
||
}
|
||
trackCrash(a0, a1);
|
||
return value;
|
||
}
|
||
trackCrash(a0, a1);
|
||
}
|
||
return value;
|
||
}
|
||
|
||
function getCrashErrorMessage(a0) { // fn#13552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:2388, offset: 0x00dee57d, size: 242 bytes, params: 2, frame: 20
|
||
var persisted_error_message;
|
||
var extra;
|
||
const exception = a0.exception;
|
||
const value = undefined;
|
||
let r0 = exception == null || exception.values == null ? value : exception.values[0];
|
||
if (r0 == null) {
|
||
extra = a0.extra;
|
||
persisted_error_message = extra == null ? value : extra.persisted_error_message;
|
||
r0 = typeof persisted_error_message !== 'string' ? value : persisted_error_message.length > 0 ? persisted_error_message : value;
|
||
r0 = r0 ?? a0.message;
|
||
} else {
|
||
var type = r0.type;
|
||
var value2 = r0.value;
|
||
if (type == null) {
|
||
extra = a0.extra;
|
||
persisted_error_message = extra == null ? value : extra.persisted_error_message;
|
||
r0 = type ?? value2;
|
||
r0 = r0 ?? a0.message;
|
||
r0 = r0 ?? (typeof persisted_error_message !== 'string' ? value : persisted_error_message.length > 0 ? persisted_error_message : value);
|
||
return r0;
|
||
}
|
||
if (value2 != null) {
|
||
return '' + type + ': ' + value2;
|
||
}
|
||
extra = a0.extra;
|
||
persisted_error_message = extra == null ? value : extra.persisted_error_message;
|
||
r0 = type ?? value2;
|
||
r0 = r0 ?? a0.message;
|
||
r0 = r0 ?? (typeof persisted_error_message !== 'string' ? value : persisted_error_message.length > 0 ? persisted_error_message : value);
|
||
}
|
||
return r0;
|
||
}
|
||
|
||
function getErrorStackTrace(a0) { // fn#13553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:2843, offset: 0x00dee66f, size: 235 bytes, params: 2, frame: 16
|
||
var persisted_error_stack;
|
||
var extra;
|
||
const exception = a0.exception;
|
||
const value = undefined;
|
||
let r2 = exception == null || exception.values == null ? value : exception.values[0];
|
||
if (r2 != null) {
|
||
var stacktrace = r2.stacktrace;
|
||
r2 = stacktrace == null || stacktrace.frames == null ? value : stacktrace.frames.map(function({filename, lineno,
|
||
colno}) {
|
||
return '' + filename + ':' + lineno + ':' + colno;
|
||
}).join('\n');
|
||
if (r2 == null) {
|
||
extra = a0.extra;
|
||
persisted_error_stack = extra == null ? value : extra.persisted_error_stack;
|
||
return typeof persisted_error_stack !== 'string' ? value : persisted_error_stack.length > 0 ? persisted_error_stack : value;
|
||
}
|
||
if (r2.length > 0) {
|
||
return r2;
|
||
}
|
||
}
|
||
extra = a0.extra;
|
||
persisted_error_stack = extra == null ? value : extra.persisted_error_stack;
|
||
return typeof persisted_error_stack !== 'string' ? value : persisted_error_stack.length > 0 ? persisted_error_stack : value;
|
||
}
|
||
|
||
function trackCrash(a0, a1) { // fn#13555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:3306, offset: 0x00dee790, size: 999 bytes, params: 3, frame: 25
|
||
var r3;
|
||
var r4;
|
||
var r12;
|
||
var r11;
|
||
var r9;
|
||
var tags;
|
||
var markCrashHandled_13557Binding;
|
||
var event_id;
|
||
var moduleValue;
|
||
var location;
|
||
var timestamp;
|
||
var value9;
|
||
var value11;
|
||
var Number;
|
||
var defaultImport;
|
||
var track;
|
||
var APP_CRASHED;
|
||
var APP_NATIVE_CRASH;
|
||
var getStringExtraBinding;
|
||
const AppCrashedReasons = (require(12842) /* metro dependency 12842: AppCrashedReasons */).AppCrashedReasons;
|
||
var defaultImport2;
|
||
var increment;
|
||
const MetricEvents = (require(4831) /* metro dependency 4831: MetricEvents */).MetricEvents;
|
||
var items2;
|
||
var value;
|
||
const binding = env0_10;
|
||
let object2 = {event: a0, hint: a1};
|
||
binding.info('Crash', object2);
|
||
const level = a0.level;
|
||
let extra = a0.extra;
|
||
const value2 = null;
|
||
const value3 = undefined;
|
||
if (value2 != (value2 == extra ? value3 : extra.native_is_native)) {
|
||
r3 = a0.extra.native_is_native === 'true';
|
||
} else {
|
||
tags = a0.tags;
|
||
r3 = value2 == tags ? value3 : tags['event.origin'];
|
||
r3 = r3 !== 'javascript';
|
||
}
|
||
if (level === 'fatal') {
|
||
r4 = r3 || level !== 'error' ? 1 : 0.01;
|
||
if (env0_13) {
|
||
moduleValue = require(1230) /* metro dependency 1230: router_utils */;
|
||
location = moduleValue.getHistory().location;
|
||
event_id = a0.event_id;
|
||
r4 = value2 != event_id ? event_id : value2;
|
||
timestamp = a0.timestamp;
|
||
if (value2 != timestamp) {
|
||
value9 = typeof timestamp;
|
||
if (value9 !== 'number') {
|
||
if (timestamp instanceof global.Date) {
|
||
r12 = timestamp.getTime();
|
||
} else if (value9 !== 'string') {
|
||
r12 = value3;
|
||
} else {
|
||
value11 = global.Date.parse(timestamp);
|
||
Number = global.Number;
|
||
r12 = Number.isNaN(value11) ? value3 : value11;
|
||
}
|
||
} else if (global.isNaN(timestamp)) {
|
||
if (timestamp instanceof global.Date) {
|
||
r12 = timestamp.getTime();
|
||
} else if (value9 !== 'string') {
|
||
r12 = value3;
|
||
} else {
|
||
value11 = global.Date.parse(timestamp);
|
||
Number = global.Number;
|
||
r12 = Number.isNaN(value11) ? value3 : value11;
|
||
}
|
||
} else {
|
||
r12 = 1000 * timestamp;
|
||
}
|
||
} else {
|
||
r12 = value3;
|
||
}
|
||
r12 = value2 == r12 ? global.Date.now() : r12;
|
||
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||
track = defaultImport.track;
|
||
if (r3) {
|
||
APP_NATIVE_CRASH = AnalyticEvents.APP_NATIVE_CRASH;
|
||
extra = a0.extra;
|
||
r11 = value2 != extra ? extra : {};
|
||
object2 = {did_crash: true};
|
||
event_id = a0.event_id;
|
||
object2.sentry_issue_id = value2 != event_id ? event_id : value2;
|
||
object2.client_track_timestamp = r12;
|
||
getStringExtraBinding = getStringExtra;
|
||
object2.exit_reason = getStringExtraBinding(r11.native_exit_reason);
|
||
object2.exit_description = getStringExtraBinding(r11.native_exit_description);
|
||
object2.tombstone_hash = getStringExtraBinding(r11.native_tombstone_hash);
|
||
object2.tombstone_cause = getStringExtraBinding(r11.native_tombstone_cause);
|
||
object2.tombstone = getStringExtraBinding(r11.native_tombstone);
|
||
object2.call_stack_tree = getStringExtraBinding(r11.native_tombstone_group_by);
|
||
object2.binary_name = getStringExtraBinding(r11.native_tombstone_origin);
|
||
object2.exception_message = getCrashErrorMessage(a0);
|
||
object2.exception_stacktrace = getErrorStackTrace(a0);
|
||
object2.js_error_message = getStringExtraBinding(r11.persisted_error_message);
|
||
object2.js_error_stacktrace = getStringExtraBinding(r11.persisted_error_stack);
|
||
Reflect.apply(track, defaultImport, [APP_NATIVE_CRASH, object2]);
|
||
} else {
|
||
APP_CRASHED = AnalyticEvents.APP_CRASHED;
|
||
object2 = {};
|
||
object2.path = location.pathname;
|
||
object2.client_track_timestamp = r12;
|
||
object2.sentry_issue_id = r4;
|
||
object2.extra = a1;
|
||
object2.error_message = getCrashErrorMessage(a0);
|
||
object2.error_level = value2 != level ? level : value3;
|
||
object2.error_stack = getErrorStackTrace(a0);
|
||
Reflect.apply(track, defaultImport, [APP_CRASHED, object2]);
|
||
}
|
||
markCrashHandled_13557(r4);
|
||
r9 = r3 ? AppCrashedReasons.UNHANDLED_NATIVE_ERROR : AppCrashedReasons.UNHANDLED_JS_ERROR;
|
||
defaultImport2 = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
||
increment = defaultImport2.increment;
|
||
object2 = {};
|
||
APP_CRASHED = MetricEvents.APP_CRASHED;
|
||
object2.name = APP_CRASHED;
|
||
value = 'reason:' + r9;
|
||
items2 = [value];
|
||
value = 'unknown';
|
||
items2[1] = 'level:' + (value2 != level ? level : value);
|
||
object2.tags = items2;
|
||
Reflect.apply(increment, defaultImport2, [object2, true]);
|
||
return a0;
|
||
}
|
||
if (sample(r4)) {
|
||
moduleValue = require(1230) /* metro dependency 1230: router_utils */;
|
||
location = moduleValue.getHistory().location;
|
||
event_id = a0.event_id;
|
||
r4 = value2 != event_id ? event_id : value2;
|
||
timestamp = a0.timestamp;
|
||
if (value2 != timestamp) {
|
||
value9 = typeof timestamp;
|
||
if (value9 !== 'number') {
|
||
if (timestamp instanceof global.Date) {
|
||
r12 = timestamp.getTime();
|
||
} else if (value9 !== 'string') {
|
||
r12 = value3;
|
||
} else {
|
||
value11 = global.Date.parse(timestamp);
|
||
Number = global.Number;
|
||
r12 = Number.isNaN(value11) ? value3 : value11;
|
||
}
|
||
} else if (global.isNaN(timestamp)) {
|
||
if (timestamp instanceof global.Date) {
|
||
r12 = timestamp.getTime();
|
||
} else if (value9 !== 'string') {
|
||
r12 = value3;
|
||
} else {
|
||
value11 = global.Date.parse(timestamp);
|
||
Number = global.Number;
|
||
r12 = Number.isNaN(value11) ? value3 : value11;
|
||
}
|
||
} else {
|
||
r12 = 1000 * timestamp;
|
||
}
|
||
} else {
|
||
r12 = value3;
|
||
}
|
||
r12 = value2 == r12 ? global.Date.now() : r12;
|
||
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||
track = defaultImport.track;
|
||
if (r3) {
|
||
APP_NATIVE_CRASH = AnalyticEvents.APP_NATIVE_CRASH;
|
||
extra = a0.extra;
|
||
r11 = value2 != extra ? extra : {};
|
||
object2 = {did_crash: true};
|
||
event_id = a0.event_id;
|
||
object2.sentry_issue_id = value2 != event_id ? event_id : value2;
|
||
object2.client_track_timestamp = r12;
|
||
getStringExtraBinding = getStringExtra;
|
||
object2.exit_reason = getStringExtraBinding(r11.native_exit_reason);
|
||
object2.exit_description = getStringExtraBinding(r11.native_exit_description);
|
||
object2.tombstone_hash = getStringExtraBinding(r11.native_tombstone_hash);
|
||
object2.tombstone_cause = getStringExtraBinding(r11.native_tombstone_cause);
|
||
object2.tombstone = getStringExtraBinding(r11.native_tombstone);
|
||
object2.call_stack_tree = getStringExtraBinding(r11.native_tombstone_group_by);
|
||
object2.binary_name = getStringExtraBinding(r11.native_tombstone_origin);
|
||
object2.exception_message = getCrashErrorMessage(a0);
|
||
object2.exception_stacktrace = getErrorStackTrace(a0);
|
||
object2.js_error_message = getStringExtraBinding(r11.persisted_error_message);
|
||
object2.js_error_stacktrace = getStringExtraBinding(r11.persisted_error_stack);
|
||
Reflect.apply(track, defaultImport, [APP_NATIVE_CRASH, object2]);
|
||
} else {
|
||
APP_CRASHED = AnalyticEvents.APP_CRASHED;
|
||
object2 = {};
|
||
object2.path = location.pathname;
|
||
object2.client_track_timestamp = r12;
|
||
object2.sentry_issue_id = r4;
|
||
object2.extra = a1;
|
||
object2.error_message = getCrashErrorMessage(a0);
|
||
object2.error_level = value2 != level ? level : value3;
|
||
object2.error_stack = getErrorStackTrace(a0);
|
||
Reflect.apply(track, defaultImport, [APP_CRASHED, object2]);
|
||
}
|
||
markCrashHandled_13557(r4);
|
||
r9 = r3 ? AppCrashedReasons.UNHANDLED_NATIVE_ERROR : AppCrashedReasons.UNHANDLED_JS_ERROR;
|
||
defaultImport2 = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
||
increment = defaultImport2.increment;
|
||
object2 = {};
|
||
APP_CRASHED = MetricEvents.APP_CRASHED;
|
||
object2.name = APP_CRASHED;
|
||
value = 'reason:' + r9;
|
||
items2 = [value];
|
||
value = 'unknown';
|
||
items2[1] = 'level:' + (value2 != level ? level : value);
|
||
object2.tags = items2;
|
||
Reflect.apply(increment, defaultImport2, [object2, true]);
|
||
return a0;
|
||
}
|
||
markCrashHandled_13557Binding = markCrashHandled_13557;
|
||
event_id = a0.event_id;
|
||
markCrashHandled_13557Binding(event_id);
|
||
} else {
|
||
if (level === 'error') {
|
||
r4 = r3 || level !== 'error' ? 1 : 0.01;
|
||
if (env0_13) {
|
||
moduleValue = require(1230) /* metro dependency 1230: router_utils */;
|
||
location = moduleValue.getHistory().location;
|
||
event_id = a0.event_id;
|
||
r4 = value2 != event_id ? event_id : value2;
|
||
timestamp = a0.timestamp;
|
||
if (value2 != timestamp) {
|
||
value9 = typeof timestamp;
|
||
if (value9 !== 'number') {
|
||
if (timestamp instanceof global.Date) {
|
||
r12 = timestamp.getTime();
|
||
} else if (value9 !== 'string') {
|
||
r12 = value3;
|
||
} else {
|
||
value11 = global.Date.parse(timestamp);
|
||
Number = global.Number;
|
||
r12 = Number.isNaN(value11) ? value3 : value11;
|
||
}
|
||
} else if (global.isNaN(timestamp)) {
|
||
if (timestamp instanceof global.Date) {
|
||
r12 = timestamp.getTime();
|
||
} else if (value9 !== 'string') {
|
||
r12 = value3;
|
||
} else {
|
||
value11 = global.Date.parse(timestamp);
|
||
Number = global.Number;
|
||
r12 = Number.isNaN(value11) ? value3 : value11;
|
||
}
|
||
} else {
|
||
r12 = 1000 * timestamp;
|
||
}
|
||
} else {
|
||
r12 = value3;
|
||
}
|
||
r12 = value2 == r12 ? global.Date.now() : r12;
|
||
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||
track = defaultImport.track;
|
||
if (r3) {
|
||
APP_NATIVE_CRASH = AnalyticEvents.APP_NATIVE_CRASH;
|
||
extra = a0.extra;
|
||
r11 = value2 != extra ? extra : {};
|
||
object2 = {did_crash: true};
|
||
event_id = a0.event_id;
|
||
object2.sentry_issue_id = value2 != event_id ? event_id : value2;
|
||
object2.client_track_timestamp = r12;
|
||
getStringExtraBinding = getStringExtra;
|
||
object2.exit_reason = getStringExtraBinding(r11.native_exit_reason);
|
||
object2.exit_description = getStringExtraBinding(r11.native_exit_description);
|
||
object2.tombstone_hash = getStringExtraBinding(r11.native_tombstone_hash);
|
||
object2.tombstone_cause = getStringExtraBinding(r11.native_tombstone_cause);
|
||
object2.tombstone = getStringExtraBinding(r11.native_tombstone);
|
||
object2.call_stack_tree = getStringExtraBinding(r11.native_tombstone_group_by);
|
||
object2.binary_name = getStringExtraBinding(r11.native_tombstone_origin);
|
||
object2.exception_message = getCrashErrorMessage(a0);
|
||
object2.exception_stacktrace = getErrorStackTrace(a0);
|
||
object2.js_error_message = getStringExtraBinding(r11.persisted_error_message);
|
||
object2.js_error_stacktrace = getStringExtraBinding(r11.persisted_error_stack);
|
||
Reflect.apply(track, defaultImport, [APP_NATIVE_CRASH, object2]);
|
||
} else {
|
||
APP_CRASHED = AnalyticEvents.APP_CRASHED;
|
||
object2 = {};
|
||
object2.path = location.pathname;
|
||
object2.client_track_timestamp = r12;
|
||
object2.sentry_issue_id = r4;
|
||
object2.extra = a1;
|
||
object2.error_message = getCrashErrorMessage(a0);
|
||
object2.error_level = value2 != level ? level : value3;
|
||
object2.error_stack = getErrorStackTrace(a0);
|
||
Reflect.apply(track, defaultImport, [APP_CRASHED, object2]);
|
||
}
|
||
markCrashHandled_13557(r4);
|
||
r9 = r3 ? AppCrashedReasons.UNHANDLED_NATIVE_ERROR : AppCrashedReasons.UNHANDLED_JS_ERROR;
|
||
defaultImport2 = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
||
increment = defaultImport2.increment;
|
||
object2 = {};
|
||
APP_CRASHED = MetricEvents.APP_CRASHED;
|
||
object2.name = APP_CRASHED;
|
||
value = 'reason:' + r9;
|
||
items2 = [value];
|
||
value = 'unknown';
|
||
items2[1] = 'level:' + (value2 != level ? level : value);
|
||
object2.tags = items2;
|
||
Reflect.apply(increment, defaultImport2, [object2, true]);
|
||
return a0;
|
||
}
|
||
if (sample(r4)) {
|
||
moduleValue = require(1230) /* metro dependency 1230: router_utils */;
|
||
location = moduleValue.getHistory().location;
|
||
event_id = a0.event_id;
|
||
r4 = value2 != event_id ? event_id : value2;
|
||
timestamp = a0.timestamp;
|
||
if (value2 != timestamp) {
|
||
value9 = typeof timestamp;
|
||
if (value9 !== 'number') {
|
||
if (timestamp instanceof global.Date) {
|
||
r12 = timestamp.getTime();
|
||
} else if (value9 !== 'string') {
|
||
r12 = value3;
|
||
} else {
|
||
value11 = global.Date.parse(timestamp);
|
||
Number = global.Number;
|
||
r12 = Number.isNaN(value11) ? value3 : value11;
|
||
}
|
||
} else if (global.isNaN(timestamp)) {
|
||
if (timestamp instanceof global.Date) {
|
||
r12 = timestamp.getTime();
|
||
} else if (value9 !== 'string') {
|
||
r12 = value3;
|
||
} else {
|
||
value11 = global.Date.parse(timestamp);
|
||
Number = global.Number;
|
||
r12 = Number.isNaN(value11) ? value3 : value11;
|
||
}
|
||
} else {
|
||
r12 = 1000 * timestamp;
|
||
}
|
||
} else {
|
||
r12 = value3;
|
||
}
|
||
r12 = value2 == r12 ? global.Date.now() : r12;
|
||
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||
track = defaultImport.track;
|
||
if (r3) {
|
||
APP_NATIVE_CRASH = AnalyticEvents.APP_NATIVE_CRASH;
|
||
extra = a0.extra;
|
||
r11 = value2 != extra ? extra : {};
|
||
object2 = {did_crash: true};
|
||
event_id = a0.event_id;
|
||
object2.sentry_issue_id = value2 != event_id ? event_id : value2;
|
||
object2.client_track_timestamp = r12;
|
||
getStringExtraBinding = getStringExtra;
|
||
object2.exit_reason = getStringExtraBinding(r11.native_exit_reason);
|
||
object2.exit_description = getStringExtraBinding(r11.native_exit_description);
|
||
object2.tombstone_hash = getStringExtraBinding(r11.native_tombstone_hash);
|
||
object2.tombstone_cause = getStringExtraBinding(r11.native_tombstone_cause);
|
||
object2.tombstone = getStringExtraBinding(r11.native_tombstone);
|
||
object2.call_stack_tree = getStringExtraBinding(r11.native_tombstone_group_by);
|
||
object2.binary_name = getStringExtraBinding(r11.native_tombstone_origin);
|
||
object2.exception_message = getCrashErrorMessage(a0);
|
||
object2.exception_stacktrace = getErrorStackTrace(a0);
|
||
object2.js_error_message = getStringExtraBinding(r11.persisted_error_message);
|
||
object2.js_error_stacktrace = getStringExtraBinding(r11.persisted_error_stack);
|
||
Reflect.apply(track, defaultImport, [APP_NATIVE_CRASH, object2]);
|
||
} else {
|
||
APP_CRASHED = AnalyticEvents.APP_CRASHED;
|
||
object2 = {};
|
||
object2.path = location.pathname;
|
||
object2.client_track_timestamp = r12;
|
||
object2.sentry_issue_id = r4;
|
||
object2.extra = a1;
|
||
object2.error_message = getCrashErrorMessage(a0);
|
||
object2.error_level = value2 != level ? level : value3;
|
||
object2.error_stack = getErrorStackTrace(a0);
|
||
Reflect.apply(track, defaultImport, [APP_CRASHED, object2]);
|
||
}
|
||
markCrashHandled_13557(r4);
|
||
r9 = r3 ? AppCrashedReasons.UNHANDLED_NATIVE_ERROR : AppCrashedReasons.UNHANDLED_JS_ERROR;
|
||
defaultImport2 = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
||
increment = defaultImport2.increment;
|
||
object2 = {};
|
||
APP_CRASHED = MetricEvents.APP_CRASHED;
|
||
object2.name = APP_CRASHED;
|
||
value = 'reason:' + r9;
|
||
items2 = [value];
|
||
value = 'unknown';
|
||
items2[1] = 'level:' + (value2 != level ? level : value);
|
||
object2.tags = items2;
|
||
Reflect.apply(increment, defaultImport2, [object2, true]);
|
||
return a0;
|
||
}
|
||
markCrashHandled_13557Binding = markCrashHandled_13557;
|
||
event_id = a0.event_id;
|
||
markCrashHandled_13557Binding(event_id);
|
||
return value3;
|
||
}
|
||
if (value2 != level) {
|
||
return a0;
|
||
}
|
||
r4 = r3 || level !== 'error' ? 1 : 0.01;
|
||
if (env0_13) {
|
||
moduleValue = require(1230) /* metro dependency 1230: router_utils */;
|
||
location = moduleValue.getHistory().location;
|
||
event_id = a0.event_id;
|
||
r4 = value2 != event_id ? event_id : value2;
|
||
timestamp = a0.timestamp;
|
||
if (value2 != timestamp) {
|
||
value9 = typeof timestamp;
|
||
if (value9 !== 'number') {
|
||
if (timestamp instanceof global.Date) {
|
||
r12 = timestamp.getTime();
|
||
} else if (value9 !== 'string') {
|
||
r12 = value3;
|
||
} else {
|
||
value11 = global.Date.parse(timestamp);
|
||
Number = global.Number;
|
||
r12 = Number.isNaN(value11) ? value3 : value11;
|
||
}
|
||
} else if (global.isNaN(timestamp)) {
|
||
if (timestamp instanceof global.Date) {
|
||
r12 = timestamp.getTime();
|
||
} else if (value9 !== 'string') {
|
||
r12 = value3;
|
||
} else {
|
||
value11 = global.Date.parse(timestamp);
|
||
Number = global.Number;
|
||
r12 = Number.isNaN(value11) ? value3 : value11;
|
||
}
|
||
} else {
|
||
r12 = 1000 * timestamp;
|
||
}
|
||
} else {
|
||
r12 = value3;
|
||
}
|
||
r12 = value2 == r12 ? global.Date.now() : r12;
|
||
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||
track = defaultImport.track;
|
||
if (r3) {
|
||
APP_NATIVE_CRASH = AnalyticEvents.APP_NATIVE_CRASH;
|
||
extra = a0.extra;
|
||
r11 = value2 != extra ? extra : {};
|
||
object2 = {did_crash: true};
|
||
event_id = a0.event_id;
|
||
object2.sentry_issue_id = value2 != event_id ? event_id : value2;
|
||
object2.client_track_timestamp = r12;
|
||
getStringExtraBinding = getStringExtra;
|
||
object2.exit_reason = getStringExtraBinding(r11.native_exit_reason);
|
||
object2.exit_description = getStringExtraBinding(r11.native_exit_description);
|
||
object2.tombstone_hash = getStringExtraBinding(r11.native_tombstone_hash);
|
||
object2.tombstone_cause = getStringExtraBinding(r11.native_tombstone_cause);
|
||
object2.tombstone = getStringExtraBinding(r11.native_tombstone);
|
||
object2.call_stack_tree = getStringExtraBinding(r11.native_tombstone_group_by);
|
||
object2.binary_name = getStringExtraBinding(r11.native_tombstone_origin);
|
||
object2.exception_message = getCrashErrorMessage(a0);
|
||
object2.exception_stacktrace = getErrorStackTrace(a0);
|
||
object2.js_error_message = getStringExtraBinding(r11.persisted_error_message);
|
||
object2.js_error_stacktrace = getStringExtraBinding(r11.persisted_error_stack);
|
||
Reflect.apply(track, defaultImport, [APP_NATIVE_CRASH, object2]);
|
||
} else {
|
||
APP_CRASHED = AnalyticEvents.APP_CRASHED;
|
||
object2 = {};
|
||
object2.path = location.pathname;
|
||
object2.client_track_timestamp = r12;
|
||
object2.sentry_issue_id = r4;
|
||
object2.extra = a1;
|
||
object2.error_message = getCrashErrorMessage(a0);
|
||
object2.error_level = value2 != level ? level : value3;
|
||
object2.error_stack = getErrorStackTrace(a0);
|
||
Reflect.apply(track, defaultImport, [APP_CRASHED, object2]);
|
||
}
|
||
markCrashHandled_13557(r4);
|
||
r9 = r3 ? AppCrashedReasons.UNHANDLED_NATIVE_ERROR : AppCrashedReasons.UNHANDLED_JS_ERROR;
|
||
defaultImport2 = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
||
increment = defaultImport2.increment;
|
||
object2 = {};
|
||
APP_CRASHED = MetricEvents.APP_CRASHED;
|
||
object2.name = APP_CRASHED;
|
||
value = 'reason:' + r9;
|
||
items2 = [value];
|
||
value = 'unknown';
|
||
items2[1] = 'level:' + (value2 != level ? level : value);
|
||
object2.tags = items2;
|
||
Reflect.apply(increment, defaultImport2, [object2, true]);
|
||
return a0;
|
||
}
|
||
if (sample(r4)) {
|
||
moduleValue = require(1230) /* metro dependency 1230: router_utils */;
|
||
location = moduleValue.getHistory().location;
|
||
event_id = a0.event_id;
|
||
r4 = value2 != event_id ? event_id : value2;
|
||
timestamp = a0.timestamp;
|
||
if (value2 != timestamp) {
|
||
value9 = typeof timestamp;
|
||
if (value9 !== 'number') {
|
||
if (timestamp instanceof global.Date) {
|
||
r12 = timestamp.getTime();
|
||
} else if (value9 !== 'string') {
|
||
r12 = value3;
|
||
} else {
|
||
value11 = global.Date.parse(timestamp);
|
||
Number = global.Number;
|
||
r12 = Number.isNaN(value11) ? value3 : value11;
|
||
}
|
||
} else if (global.isNaN(timestamp)) {
|
||
if (timestamp instanceof global.Date) {
|
||
r12 = timestamp.getTime();
|
||
} else if (value9 !== 'string') {
|
||
r12 = value3;
|
||
} else {
|
||
value11 = global.Date.parse(timestamp);
|
||
Number = global.Number;
|
||
r12 = Number.isNaN(value11) ? value3 : value11;
|
||
}
|
||
} else {
|
||
r12 = 1000 * timestamp;
|
||
}
|
||
} else {
|
||
r12 = value3;
|
||
}
|
||
r12 = value2 == r12 ? global.Date.now() : r12;
|
||
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||
track = defaultImport.track;
|
||
if (r3) {
|
||
APP_NATIVE_CRASH = AnalyticEvents.APP_NATIVE_CRASH;
|
||
extra = a0.extra;
|
||
r11 = value2 != extra ? extra : {};
|
||
object2 = {did_crash: true};
|
||
event_id = a0.event_id;
|
||
object2.sentry_issue_id = value2 != event_id ? event_id : value2;
|
||
object2.client_track_timestamp = r12;
|
||
getStringExtraBinding = getStringExtra;
|
||
object2.exit_reason = getStringExtraBinding(r11.native_exit_reason);
|
||
object2.exit_description = getStringExtraBinding(r11.native_exit_description);
|
||
object2.tombstone_hash = getStringExtraBinding(r11.native_tombstone_hash);
|
||
object2.tombstone_cause = getStringExtraBinding(r11.native_tombstone_cause);
|
||
object2.tombstone = getStringExtraBinding(r11.native_tombstone);
|
||
object2.call_stack_tree = getStringExtraBinding(r11.native_tombstone_group_by);
|
||
object2.binary_name = getStringExtraBinding(r11.native_tombstone_origin);
|
||
object2.exception_message = getCrashErrorMessage(a0);
|
||
object2.exception_stacktrace = getErrorStackTrace(a0);
|
||
object2.js_error_message = getStringExtraBinding(r11.persisted_error_message);
|
||
object2.js_error_stacktrace = getStringExtraBinding(r11.persisted_error_stack);
|
||
Reflect.apply(track, defaultImport, [APP_NATIVE_CRASH, object2]);
|
||
} else {
|
||
APP_CRASHED = AnalyticEvents.APP_CRASHED;
|
||
object2 = {};
|
||
object2.path = location.pathname;
|
||
object2.client_track_timestamp = r12;
|
||
object2.sentry_issue_id = r4;
|
||
object2.extra = a1;
|
||
object2.error_message = getCrashErrorMessage(a0);
|
||
object2.error_level = value2 != level ? level : value3;
|
||
object2.error_stack = getErrorStackTrace(a0);
|
||
Reflect.apply(track, defaultImport, [APP_CRASHED, object2]);
|
||
}
|
||
markCrashHandled_13557(r4);
|
||
r9 = r3 ? AppCrashedReasons.UNHANDLED_NATIVE_ERROR : AppCrashedReasons.UNHANDLED_JS_ERROR;
|
||
defaultImport2 = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
||
increment = defaultImport2.increment;
|
||
object2 = {};
|
||
APP_CRASHED = MetricEvents.APP_CRASHED;
|
||
object2.name = APP_CRASHED;
|
||
value = 'reason:' + r9;
|
||
items2 = [value];
|
||
value = 'unknown';
|
||
items2[1] = 'level:' + (value2 != level ? level : value);
|
||
object2.tags = items2;
|
||
Reflect.apply(increment, defaultImport2, [object2, true]);
|
||
return a0;
|
||
}
|
||
markCrashHandled_13557(a0.event_id);
|
||
}
|
||
return value3;
|
||
}
|
||
|
||
function markCrashHandled_13557(a0) { // fn#13557, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:5331, offset: 0x00deeb92, size: 71 bytes, params: 2, frame: 12
|
||
if (typeof a0 === 'string' && a0.length !== 0) {
|
||
(importDefault(1216) /* metro dependency 1216: SentryUtilsNative */).markCrashHandled(a0);
|
||
}
|
||
}
|
||
|
||
function initSentry() { // fn#13559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:5610, offset: 0x00deebfe, size: 43 bytes, params: 1, frame: 11
|
||
const CrashReportingManager = NativeModules.CrashReportingManager;
|
||
if (CrashReportingManager != null) {
|
||
CrashReportingManager.getIsUserStaffForCrashReporting(_fun13560);
|
||
}
|
||
}
|
||
|
||
function* _fun13542(a0) { // fn#13542, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:848, offset: 0x00dee155, size: 279 bytes, params: 2, frame: 18
|
||
var environment;
|
||
var r4;
|
||
var Promise;
|
||
var race;
|
||
var items2;
|
||
var promise;
|
||
var entries;
|
||
let value = undefined;
|
||
if (false) {
|
||
return value;
|
||
}
|
||
const breadcrumbs = a0.breadcrumbs;
|
||
const Array = global.Array;
|
||
if (Array.isArray(breadcrumbs)) {
|
||
if (breadcrumbs.length > 0) {
|
||
return undefined;
|
||
}
|
||
value = environment.__proto__.__proto__;
|
||
value = env2_0(env2_3[6]).SentryTelemetry.snapshotForBreadcrumbs();
|
||
Promise = global.Promise;
|
||
race = Promise.race;
|
||
items2 = [value];
|
||
promise = new global.Promise(function(a0, a1) {
|
||
var env0_0 = a1;
|
||
return global.setTimeout(_fun13544, 200);
|
||
});
|
||
items2[1] = promise;
|
||
promise = Reflect.apply(race, Promise, [items2]);
|
||
yield promise.catch(_fun13545);
|
||
promise = undefined;
|
||
if (false) {
|
||
return promise;
|
||
}
|
||
r4 = promise != null && global.Array.isArray(promise.entries);
|
||
r4 = r4 && promise.entries.length !== 0;
|
||
if (r4) {
|
||
entries = promise.entries;
|
||
a0.breadcrumbs = entries.map(_fun13546);
|
||
}
|
||
} else {
|
||
value = environment.__proto__.__proto__;
|
||
value = env2_0(env2_3[6]).SentryTelemetry.snapshotForBreadcrumbs();
|
||
Promise = global.Promise;
|
||
race = Promise.race;
|
||
items2 = [value];
|
||
promise = new global.Promise(function(a0, a1) {
|
||
var env0_0 = a1;
|
||
return global.setTimeout(_fun13544, 200);
|
||
});
|
||
items2[1] = promise;
|
||
promise = Reflect.apply(race, Promise, [items2]);
|
||
yield promise.catch(function() {
|
||
return null;
|
||
});
|
||
promise = undefined;
|
||
if (false) {
|
||
return promise;
|
||
}
|
||
r4 = promise != null && global.Array.isArray(promise.entries);
|
||
r4 = r4 && promise.entries.length !== 0;
|
||
if (r4) {
|
||
entries = promise.entries;
|
||
a0.breadcrumbs = entries.map(function(a0) {
|
||
return {message: a0.message ?? a0.key, category: 'telemetry_ring',
|
||
timestamp: a0.timestamp / 1000, data: a0.data};
|
||
});
|
||
}
|
||
}
|
||
}
|
||
|
||
function* _fun13549() { // fn#13549, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:2060, offset: 0x00dee483, size: 196 bytes, params: 1, frame: 18
|
||
var environment;
|
||
var Promise;
|
||
var race;
|
||
var binding;
|
||
var binding2;
|
||
var property;
|
||
var ZoomedInTelemetry;
|
||
var flushNow;
|
||
var items2;
|
||
var Promise2;
|
||
var prototype;
|
||
var closure;
|
||
var promise;
|
||
var value3;
|
||
var value4;
|
||
var error;
|
||
if (false) {
|
||
return undefined;
|
||
}
|
||
try {
|
||
Promise = global.Promise;
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
race = Promise.race;
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
value = environment.__proto__.__proto__;
|
||
try {
|
||
binding = env2_0;
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
binding2 = env2_3;
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
property = binding2[6];
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
value = binding(property);
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
ZoomedInTelemetry = value.ZoomedInTelemetry;
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
flushNow = ZoomedInTelemetry.flushNow;
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
value = Reflect.apply(flushNow, ZoomedInTelemetry, []);
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
items2 = [];
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
items2[0] = value;
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
Promise2 = global.Promise;
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
prototype = Promise2.prototype;
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
closure = function(a0) {
|
||
return (0, global.setTimeout)(a0, 200);
|
||
};
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
promise = new Promise2();
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
value = promise instanceof Object ? promise : value;
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
items2[1] = value;
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
value = Reflect.apply(race, Promise, [items2]);
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
yield value;
|
||
try {
|
||
value = undefined;
|
||
value3 = false;
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
if (value3) {
|
||
return value;
|
||
}
|
||
value = environment.__proto__;
|
||
try {
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
closure = maybeBackfillMissingBreadcrumbsFromTelemetryRing;
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
try {
|
||
value = closure(require);
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
yield value;
|
||
try {
|
||
value = undefined;
|
||
value4 = false;
|
||
} catch (error) {
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
if (value4) {
|
||
return value;
|
||
}
|
||
value = environment.__proto__.__proto__;
|
||
binding = env2_19;
|
||
value = environment.__proto__;
|
||
binding(require, importDefault);
|
||
return require;
|
||
}
|
||
|
||
function _fun13560(a0) { // fn#13560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:5708, offset: 0x00deec29, size: 792 bytes, params: 2, frame: 24
|
||
var environment;
|
||
var r10;
|
||
var isStable;
|
||
var binding;
|
||
var verbose;
|
||
var object2;
|
||
var moduleValue2;
|
||
var device;
|
||
var moduleValue4;
|
||
var init;
|
||
var items2;
|
||
const DesignIds = (require(658) /* metro dependency 658: DesignIds */).DesignIds;
|
||
const isBridgeless = (require(4020) /* metro dependency 4020: FabricUtils */).isBridgeless;
|
||
let value = environment.__proto__;
|
||
env1_13 = a0;
|
||
const constants = (importAll(1582) /* metro dependency 1582: ClientInfoUtils */).getConstants();
|
||
const ReleaseChannel = constants.ReleaseChannel;
|
||
if (ReleaseChannel.indexOf('debug') === -1) {
|
||
if (ReleaseChannel.indexOf('developer') === -1) {
|
||
isStable = (require(4827) /* metro dependency 4827: ReleaseChannelUtilsNative */).isStable;
|
||
binding = env1_10;
|
||
verbose = binding.verbose;
|
||
object2 = {releaseChannel: ReleaseChannel, isProductionChannel: isStable};
|
||
Reflect.apply(verbose, binding, ['Initialize', object2]);
|
||
moduleValue2 = require(477) /* metro dependency 477: PlatformUtils */;
|
||
if (moduleValue2.isAndroid()) {
|
||
if (isStable) {
|
||
device = (require(4092) /* metro dependency 4092: DeviceUtils */).getDevice();
|
||
if (device.indexOf('vivo') === -1) {
|
||
r10 = isStable ? constants.SentryDsn : constants.SentryAlphaBetaDsn;
|
||
r10 = a0 ? constants.SentryStaffDsn : r10;
|
||
replayPendingCrashReportIfNeeded();
|
||
moduleValue4 = require(819) /* metro dependency 819 */;
|
||
init = moduleValue4.init;
|
||
object2 = {};
|
||
object2.tunnel = '/error-reporting-proxy/' + ((require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'android' : 'ios');
|
||
object2.autoInitializeNativeSdk = false;
|
||
object2.beforeSend = filterError;
|
||
object2.dist = '5867';
|
||
object2.dsn = r10;
|
||
object2.environment = ReleaseChannel;
|
||
object2.tracesSampleRate = 0;
|
||
object2.sampleRate = 1;
|
||
object2.ignoreErrors = env1_11;
|
||
object2.release = '[email protected]+335011';
|
||
object2.tracePropagationTargets = [PRIMARY_DOMAIN];
|
||
items2 = [env1_8];
|
||
value = require(819) /* metro dependency 819 */;
|
||
items2[1] = value.featureFlagsIntegration();
|
||
value = require(819) /* metro dependency 819 */;
|
||
items2[2] = value.reactNativeTracingIntegration({shouldCreateSpanForRequest: shouldCreateSpanForRequest});
|
||
object2.integrations = items2;
|
||
object2.beforeBreadcrumb = beforeBreadcrumb_13565;
|
||
Reflect.apply(init, moduleValue4, [object2]);
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('buildNumber', '5867');
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('appVersion', constants.Version);
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('design_id', '' + DesignIds.DESIGN_TABS_IA);
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('newArchEnabled',
|
||
(require(4020) /* metro dependency 4020: FabricUtils */).isFabric());
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('isBridgeless', isBridgeless);
|
||
}
|
||
} else {
|
||
r10 = isStable ? constants.SentryDsn : constants.SentryAlphaBetaDsn;
|
||
r10 = a0 ? constants.SentryStaffDsn : r10;
|
||
replayPendingCrashReportIfNeeded();
|
||
moduleValue4 = require(819) /* metro dependency 819 */;
|
||
init = moduleValue4.init;
|
||
object2 = {};
|
||
object2.tunnel = '/error-reporting-proxy/' + ((require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'android' : 'ios');
|
||
object2.autoInitializeNativeSdk = false;
|
||
object2.beforeSend = filterError;
|
||
object2.dist = '5867';
|
||
object2.dsn = r10;
|
||
object2.environment = ReleaseChannel;
|
||
object2.tracesSampleRate = 0;
|
||
object2.sampleRate = 1;
|
||
object2.ignoreErrors = env1_11;
|
||
object2.release = '[email protected]+335011';
|
||
object2.tracePropagationTargets = [PRIMARY_DOMAIN];
|
||
items2 = [env1_8];
|
||
value = require(819) /* metro dependency 819 */;
|
||
items2[1] = value.featureFlagsIntegration();
|
||
value = require(819) /* metro dependency 819 */;
|
||
items2[2] = value.reactNativeTracingIntegration({shouldCreateSpanForRequest: shouldCreateSpanForRequest});
|
||
object2.integrations = items2;
|
||
object2.beforeBreadcrumb = beforeBreadcrumb_13565;
|
||
Reflect.apply(init, moduleValue4, [object2]);
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('buildNumber', '5867');
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('appVersion', constants.Version);
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('design_id', '' + DesignIds.DESIGN_TABS_IA);
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('newArchEnabled', (require(4020) /* metro dependency 4020: FabricUtils */).isFabric());
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('isBridgeless', isBridgeless);
|
||
}
|
||
} else {
|
||
r10 = isStable ? constants.SentryDsn : constants.SentryAlphaBetaDsn;
|
||
r10 = a0 ? constants.SentryStaffDsn : r10;
|
||
replayPendingCrashReportIfNeeded();
|
||
moduleValue4 = require(819) /* metro dependency 819 */;
|
||
init = moduleValue4.init;
|
||
object2 = {};
|
||
object2.tunnel = '/error-reporting-proxy/' + ((require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'android' : 'ios');
|
||
object2.autoInitializeNativeSdk = false;
|
||
object2.beforeSend = filterError;
|
||
object2.dist = '5867';
|
||
object2.dsn = r10;
|
||
object2.environment = ReleaseChannel;
|
||
object2.tracesSampleRate = 0;
|
||
object2.sampleRate = 1;
|
||
object2.ignoreErrors = env1_11;
|
||
object2.release = '[email protected]+335011';
|
||
object2.tracePropagationTargets = [PRIMARY_DOMAIN];
|
||
items2 = [env1_8];
|
||
value = require(819) /* metro dependency 819 */;
|
||
items2[1] = value.featureFlagsIntegration();
|
||
value = require(819) /* metro dependency 819 */;
|
||
items2[2] = value.reactNativeTracingIntegration({shouldCreateSpanForRequest: shouldCreateSpanForRequest});
|
||
object2.integrations = items2;
|
||
object2.beforeBreadcrumb = beforeBreadcrumb_13565;
|
||
Reflect.apply(init, moduleValue4, [object2]);
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('buildNumber', '5867');
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('appVersion', constants.Version);
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('design_id', '' + DesignIds.DESIGN_TABS_IA);
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('newArchEnabled', (require(4020) /* metro dependency 4020: FabricUtils */).isFabric());
|
||
value = require(819) /* metro dependency 819 */;
|
||
value.setTag('isBridgeless', isBridgeless);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
function _fun13543(a0, a1) { // fn#13543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:1009, offset: 0x00dee26c, size: 35 bytes, params: 3, frame: 13
|
||
const env0_0 = a1;
|
||
return global.setTimeout(_fun13544, 200);
|
||
}
|
||
|
||
function _fun13546(a0) { // fn#13546, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:1196, offset: 0x00dee2c1, size: 67 bytes, params: 2, frame: 4
|
||
return {message: a0.message ?? a0.key, category: 'telemetry_ring', timestamp: a0.timestamp / 1000, data: a0.data};
|
||
}
|
||
|
||
function maybeBackfillMissingBreadcrumbsFromTelemetryRing() { // fn#13551, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:2177, offset: 0x00dee55f, size: 30 bytes, params: 1, frame: 13
|
||
return env3_15.apply(this, arguments);
|
||
}
|
||
|
||
function replayPendingCrashReportIfNeeded() { // fn#13561, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:6068, offset: 0x00deef41, size: 70 bytes, params: 1, frame: 13
|
||
var environment;
|
||
let value = environment.__proto__.__proto__;
|
||
value = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
|
||
value = value.getLastCrashReport();
|
||
value = value.then(_fun13562);
|
||
value.catch(_fun13563);
|
||
}
|
||
|
||
function shouldCreateSpanForRequest({match}) { // fn#13564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:6705, offset: 0x00deefd1, size: 32 bytes, params: 2, frame: 11
|
||
const binding = env2_9;
|
||
return !binding.some(match);
|
||
}
|
||
|
||
function beforeBreadcrumb_13565(a0) { // fn#13565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:6745, offset: 0x00deeff1, size: 116 bytes, params: 2, frame: 15
|
||
if (a0.data == null) {
|
||
a0.data = {};
|
||
}
|
||
let value = environment.__proto__.__proto__;
|
||
const currentMemoryUsageKB = (importDefault(5256) /* metro dependency 5256: ProcessUtilsNative */).getCurrentMemoryUsageKB();
|
||
if (currentMemoryUsageKB != null) {
|
||
a0.data.client_performance_memory = currentMemoryUsageKB;
|
||
}
|
||
value = importDefault(5256) /* metro dependency 5256: ProcessUtilsNative */;
|
||
value = value.getCurrentCPUUsagePercent();
|
||
if (value != null) {
|
||
a0.data.client_performance_cpu = value;
|
||
}
|
||
return a0;
|
||
}
|
||
|
||
function _fun13544() { // fn#13544, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:1028, offset: 0x00dee28f, size: 50 bytes, params: 1, frame: 12
|
||
const Error = global.Error;
|
||
return require(new Error('TelemetryRing breadcrumb timeout'));
|
||
}
|
||
|
||
function _fun13562(a0) { // fn#13562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:6148, offset: 0x00deef87, size: 43 bytes, params: 2, frame: 13
|
||
var value;
|
||
if (a0 != null) {
|
||
value = environment.__proto__.__proto__.__proto__;
|
||
trackCrash(a0, {crash_event_source: 'startup_reconcile'});
|
||
}
|
||
}
|
||
|
||
function _fun13563(a0) { // fn#13563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1344:6226, offset: 0x00deefb2, size: 31 bytes, params: 2, frame: 13
|
||
env3_10.warn('Failed to replay pending crash report', a0);
|
||
}
|
||
|