Initial commit
This commit is contained in:
commit
af3b49f756
16065 files changed
+2938410
No files matched your search
@@ -0,0 +1,11 @@
|
||||
/* Metro module 4880; source: modules/analytics_sessions/ClientHeartbeatPiggyback.tsx; dependencies: [4266, 2] */
|
||||
function _fun42783(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#42783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5058:6, offset: 0x0114207d, size: 100 bytes, params: 8, frame: 16
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
importDefault(4266) /* metro dependency 4266: RunningGameStoreNative */;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/analytics_sessions/ClientHeartbeatPiggyback.tsx');
|
||||
exports.getClientHeartbeatPiggybackProperties = function() {
|
||||
return {};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
/* Metro module 7113; source: modules/analytics_sessions/SessionAdGenerator.tsx; dependencies: [672, 491, 4882, 694, 1216, 2] */
|
||||
function _fun56853(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#56853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7291:6, offset: 0x013d3b9b, size: 180 bytes, params: 8, frame: 20
|
||||
const env0_0 = require;
|
||||
const closure = isAdSessionExpired;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
||||
const HOUR = Millis.HOUR;
|
||||
const env0_3 = 12 * HOUR;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/analytics_sessions/SessionAdGenerator.tsx');
|
||||
exports.getOrRefreshAdSession = getOrRefreshAdSession;
|
||||
exports.clearAdSession = function() {
|
||||
env0_4 = null;
|
||||
};
|
||||
exports.getCurrentAdSession = getCurrentAdSession;
|
||||
exports.isAdSessionExpired = closure;
|
||||
}
|
||||
|
||||
function isAdSessionExpired(a0) { // fn#56854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7291:128, offset: 0x013d3c4f, size: 193 bytes, params: 2, frame: 18
|
||||
const Date = global.Date;
|
||||
let value = Date.now();
|
||||
if (value < a0.createdAtTimestamp) {
|
||||
(importDefault(1216) /* metro dependency 1216: SentryUtilsNative */).addBreadcrumb({category: 'ad',
|
||||
message: 'future facing timestamp Date.now(): ' + value + ', initialized timestamp: ' + a0.createdAtTimestamp});
|
||||
return true;
|
||||
}
|
||||
const value2 = value - a0.lastUsedTimestamp;
|
||||
const SESSION_IDLE_TIMEOUT_MILLIS = (require(4882) /* metro dependency 4882: SessionUtils */).SESSION_IDLE_TIMEOUT_MILLIS;
|
||||
const value4 = value2 > SESSION_IDLE_TIMEOUT_MILLIS;
|
||||
value -= a0.createdAtTimestamp;
|
||||
value = value > env0_3;
|
||||
return value4 || value;
|
||||
}
|
||||
|
||||
function getOrRefreshAdSession() { // fn#56855, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7291:560, offset: 0x013d3d10, size: 194 bytes, params: 1, frame: 17
|
||||
var object2;
|
||||
const CLIENT_SESSION_STORAGE_VERSION = (require(4882) /* metro dependency 4882: SessionUtils */).CLIENT_SESSION_STORAGE_VERSION;
|
||||
let value = a0;
|
||||
let r0 = value !== undefined ? value : false;
|
||||
const Date = global.Date;
|
||||
value = Date.now();
|
||||
if (env0_4 == null) {
|
||||
object2 = {};
|
||||
object2.uuid = (require(491) /* metro dependency 491 */).v4();
|
||||
object2.createdAtTimestamp = value;
|
||||
object2.lastUsedTimestamp = value;
|
||||
object2.version = CLIENT_SESSION_STORAGE_VERSION;
|
||||
env0_4 = object2;
|
||||
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
value.dispatch({type: 'AD_SESSION_RESET'});
|
||||
r0 = env0_4;
|
||||
} else if (isAdSessionExpired(env0_4)) {
|
||||
object2 = {};
|
||||
object2.uuid = (require(491) /* metro dependency 491 */).v4();
|
||||
object2.createdAtTimestamp = value;
|
||||
object2.lastUsedTimestamp = value;
|
||||
object2.version = CLIENT_SESSION_STORAGE_VERSION;
|
||||
env0_4 = object2;
|
||||
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
value.dispatch({type: 'AD_SESSION_RESET'});
|
||||
r0 = env0_4;
|
||||
} else {
|
||||
if (r0) {
|
||||
env0_4.lastUsedTimestamp = value;
|
||||
}
|
||||
r0 = env0_4;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,323 @@
|
||||
/* Metro module 13090; source: modules/analytics_sessions/SessionAdManager.tsx; dependencies: [6, 7, 15, 17, 18, 1226, 661, 4876, 4041, 672, 1216, 7113, 683, 694, 4561, 2] */
|
||||
function _fun100027(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:6, offset: 0x021dc14a, size: 338 bytes, params: 8, frame: 19
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
||||
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
||||
const env0_5 = importDefault(15) /* metro dependency 15 */;
|
||||
const env0_6 = importDefault(17) /* metro dependency 17 */;
|
||||
const env0_7 = importDefault(18) /* metro dependency 18 */;
|
||||
let value = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
|
||||
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
||||
const env0_9 = constantsModule.AnalyticEvents;
|
||||
const env0_10 = constantsModule.AppStates;
|
||||
const env0_11 = value.getToken();
|
||||
object = {DEFAULT: 'DEFAULT', USER_LOGOUT: 'USER_LOGOUT', WINDOW_FOCUS: 'WINDOW_FOCUS',
|
||||
APP_STATE_UPDATE: 'APP_STATE_UPDATE'};
|
||||
value = importDefault(4561) /* metro dependency 4561: LifecycleManager */;
|
||||
value = _fun100031(value);
|
||||
value = new value();
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/analytics_sessions/SessionAdManager.tsx');
|
||||
exports.default = value;
|
||||
}
|
||||
|
||||
function _isNativeReflectConstruct_100028() { // fn#100028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:201, offset: 0x021dc29c, size: 98 bytes, params: 1, frame: 18
|
||||
var Boolean;
|
||||
var prototype;
|
||||
var valueOf;
|
||||
var call;
|
||||
var Reflect;
|
||||
var construct;
|
||||
var closure;
|
||||
var value;
|
||||
var error;
|
||||
try {
|
||||
Boolean = global.Boolean;
|
||||
prototype = Boolean.prototype;
|
||||
valueOf = prototype.valueOf;
|
||||
call = valueOf.call;
|
||||
Reflect = global.Reflect;
|
||||
construct = Reflect.construct;
|
||||
Boolean = global.Boolean;
|
||||
closure = function() {
|
||||
};
|
||||
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
||||
value = Reflect.apply(call, valueOf, [value]);
|
||||
var result = !value;
|
||||
} catch (error) {
|
||||
}
|
||||
return (_isNativeReflectConstruct_100028_isNativeReflectConstruct = function() {
|
||||
return !!result;
|
||||
})();
|
||||
}
|
||||
|
||||
function _fun100031(a0) { // fn#100031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:573, offset: 0x021dc2fe, size: 97 bytes, params: 2, frame: 16
|
||||
const closure = SessionAdManager;
|
||||
env0_7(closure, a0);
|
||||
return env0_4(closure, [{key: '_initialize', value: value_100044}, {key: '_terminate', value: value_100045}]);
|
||||
}
|
||||
|
||||
function SessionAdManager(a0) { // fn#100032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:585, offset: 0x021dc35f, size: 371 bytes, params: 2, frame: 22
|
||||
var r0;
|
||||
var Reflect;
|
||||
let value = copyRestArgs(0, undefined);
|
||||
let binding = env1_3;
|
||||
binding(this, SessionAdManager);
|
||||
const items2 = [];
|
||||
arraySpread(items2, value, 0, items2);
|
||||
value = env1_6(SessionAdManager);
|
||||
binding = env1_5;
|
||||
if (_isNativeReflectConstruct_100028()) {
|
||||
Reflect = global.Reflect;
|
||||
value = Reflect.construct(value, items2, env1_6(this).constructor);
|
||||
r0 = value;
|
||||
} else {
|
||||
value = value.apply(this, items2);
|
||||
r0 = value;
|
||||
}
|
||||
value = binding(this, r0);
|
||||
value.focusedOrForegrounded = (require(4876) /* metro dependency 4876: SessionForegroundUtilsNative */).isForegrounded();
|
||||
const Interval = (require(4041) /* metro dependency 4041: Timers */).Interval;
|
||||
const value4 = Object.create(Interval.prototype, {constructor: {value: Interval}});
|
||||
const interval = new Interval();
|
||||
value.heartbeatInterval = interval instanceof Object ? interval : value4;
|
||||
value.schedulerStarted = false;
|
||||
value.lastHeartbeatTimestamp = 0;
|
||||
value.maybeStartHeartbeat = maybeStartHeartbeat;
|
||||
value.startAnalyticHeartbeat = startAnalyticHeartbeat;
|
||||
value.trackHeartbeat = trackHeartbeat_100035;
|
||||
value.stopAnalyticHeartbeat = stopAnalyticHeartbeat;
|
||||
value.scheduleHeartbeatTracking = scheduleHeartbeatTracking_100037;
|
||||
value.handleLogin = handleLogin_100038;
|
||||
value.handleLogout = handleLogout_100039;
|
||||
value.handleEnrollmentSuccess = handleEnrollmentSuccess;
|
||||
value.handleWindowFocus = handleWindowFocus_100041;
|
||||
value.handleAppStateUpdate = handleAppStateUpdate_100042;
|
||||
value.handleAuthenticationChange = handleAuthenticationChange_100043;
|
||||
return value;
|
||||
}
|
||||
|
||||
function value_100044() { // fn#100044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:2901, offset: 0x021dc93e, size: 239 bytes, params: 1, frame: 18
|
||||
let value = environment.__proto__;
|
||||
const sessionForegroundUtilsNativeModule = require(4876) /* metro dependency 4876: SessionForegroundUtilsNative */;
|
||||
this.focusedOrForegrounded = sessionForegroundUtilsNativeModule.isForegrounded();
|
||||
AuthenticationStore.addChangeListener(this.handleAuthenticationChange);
|
||||
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
value.subscribe('WINDOW_FOCUS', this.handleWindowFocus);
|
||||
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
value.subscribe('APP_STATE_UPDATE', this.handleAppStateUpdate);
|
||||
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
value.subscribe('QUESTS_ENROLL_SUCCESS', this.handleEnrollmentSuccess);
|
||||
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
value.subscribe('LOGIN_SUCCESS', this.handleLogin);
|
||||
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
value.subscribe('LOGOUT', this.handleLogout);
|
||||
this.scheduleHeartbeatTracking();
|
||||
}
|
||||
|
||||
function value_100045() { // fn#100045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:3372, offset: 0x021dca2d, size: 207 bytes, params: 1, frame: 18
|
||||
this.stopAnalyticHeartbeat();
|
||||
let value = environment.__proto__;
|
||||
AuthenticationStore.removeChangeListener(this.handleAuthenticationChange);
|
||||
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
value.unsubscribe('WINDOW_FOCUS', this.handleWindowFocus);
|
||||
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
value.unsubscribe('APP_STATE_UPDATE', this.handleAppStateUpdate);
|
||||
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
value.unsubscribe('QUESTS_ENROLL_SUCCESS', this.handleEnrollmentSuccess);
|
||||
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
value.unsubscribe('LOGIN_SUCCESS', this.handleLogin);
|
||||
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
value.unsubscribe('LOGOUT', this.handleLogout);
|
||||
}
|
||||
|
||||
function maybeStartHeartbeat() { // fn#100033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:981, owner: SessionAdManager.maybeStartHeartbeat, offset: 0x021dc4d2, size: 111 bytes, params: 1, frame: 15
|
||||
var binding;
|
||||
var start;
|
||||
var value;
|
||||
let heartbeatInterval = env0_0.heartbeatInterval;
|
||||
if (!heartbeatInterval.isStarted()) {
|
||||
binding = env0_0;
|
||||
binding.trackHeartbeat();
|
||||
heartbeatInterval = binding.heartbeatInterval;
|
||||
start = heartbeatInterval.start;
|
||||
value = environment.__proto__.__proto__;
|
||||
value = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.MINUTE;
|
||||
Reflect.apply(start, heartbeatInterval, [value, binding.trackHeartbeat]);
|
||||
}
|
||||
}
|
||||
|
||||
function startAnalyticHeartbeat() { // fn#100034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:1134, owner: SessionAdManager.startAnalyticHeartbeat, offset: 0x021dc541, size: 92 bytes, params: 1, frame: 12
|
||||
var binding;
|
||||
var value;
|
||||
if (!env0_0.schedulerStarted) {
|
||||
binding = env0_0;
|
||||
binding.schedulerStarted = true;
|
||||
value = environment.__proto__.__proto__;
|
||||
value = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
|
||||
value.addBreadcrumb({'category': 'ad', 'message': 'Starting ad session heartbeat'});
|
||||
binding.maybeStartHeartbeat();
|
||||
}
|
||||
}
|
||||
|
||||
function SessionAdManagerTrackHeartbeat() { // fn#100035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:1302, owner: SessionAdManager.trackHeartbeat, offset: 0x021dc59d, size: 309 bytes, params: 1, frame: 18
|
||||
var value3;
|
||||
var value4;
|
||||
var value5;
|
||||
var orRefreshAdSession;
|
||||
var defaultImport2;
|
||||
const value = a0;
|
||||
const r6 = value !== undefined ? value : false;
|
||||
if (env0_0.schedulerStarted) {
|
||||
value3 = global.performance.now();
|
||||
value4 = value3 - env0_0.lastHeartbeatTimestamp;
|
||||
value5 = environment.__proto__.__proto__;
|
||||
if (r6) {
|
||||
orRefreshAdSession = (require(7113) /* metro dependency 7113: SessionAdGenerator */).getOrRefreshAdSession();
|
||||
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||||
defaultImport2.track(AnalyticEvents.CLIENT_AD_HEARTBEAT, {client_ad_session_id: orRefreshAdSession.uuid,
|
||||
client_heartbeat_initialization_timestamp: orRefreshAdSession.createdAtTimestamp,
|
||||
client_heartbeat_version: 3});
|
||||
env0_0.lastHeartbeatTimestamp = value3;
|
||||
} else if (env0_0.lastHeartbeatTimestamp > 0) {
|
||||
if (!(value4 < 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.MINUTE)) {
|
||||
orRefreshAdSession = (require(7113) /* metro dependency 7113: SessionAdGenerator */).getOrRefreshAdSession();
|
||||
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||||
defaultImport2.track(AnalyticEvents.CLIENT_AD_HEARTBEAT, {client_ad_session_id: orRefreshAdSession.uuid,
|
||||
client_heartbeat_initialization_timestamp: orRefreshAdSession.createdAtTimestamp,
|
||||
client_heartbeat_version: 3});
|
||||
env0_0.lastHeartbeatTimestamp = value3;
|
||||
}
|
||||
} else {
|
||||
orRefreshAdSession = (require(7113) /* metro dependency 7113: SessionAdGenerator */).getOrRefreshAdSession();
|
||||
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||||
defaultImport2.track(AnalyticEvents.CLIENT_AD_HEARTBEAT, {client_ad_session_id: orRefreshAdSession.uuid,
|
||||
client_heartbeat_initialization_timestamp: orRefreshAdSession.createdAtTimestamp,
|
||||
client_heartbeat_version: 3});
|
||||
env0_0.lastHeartbeatTimestamp = value3;
|
||||
}
|
||||
} else {
|
||||
if (r6) {
|
||||
value3 = global.performance.now();
|
||||
value4 = value3 - env0_0.lastHeartbeatTimestamp;
|
||||
value5 = environment.__proto__.__proto__;
|
||||
if (r6) {
|
||||
orRefreshAdSession = (require(7113) /* metro dependency 7113: SessionAdGenerator */).getOrRefreshAdSession();
|
||||
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||||
defaultImport2.track(AnalyticEvents.CLIENT_AD_HEARTBEAT, {client_ad_session_id: orRefreshAdSession.uuid,
|
||||
client_heartbeat_initialization_timestamp: orRefreshAdSession.createdAtTimestamp,
|
||||
client_heartbeat_version: 3});
|
||||
env0_0.lastHeartbeatTimestamp = value3;
|
||||
} else if (env0_0.lastHeartbeatTimestamp > 0) {
|
||||
if (!(value4 < 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.MINUTE)) {
|
||||
orRefreshAdSession = (require(7113) /* metro dependency 7113: SessionAdGenerator */).getOrRefreshAdSession();
|
||||
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||||
defaultImport2.track(AnalyticEvents.CLIENT_AD_HEARTBEAT,
|
||||
{client_ad_session_id: orRefreshAdSession.uuid,
|
||||
client_heartbeat_initialization_timestamp: orRefreshAdSession.createdAtTimestamp,
|
||||
client_heartbeat_version: 3});
|
||||
env0_0.lastHeartbeatTimestamp = value3;
|
||||
}
|
||||
} else {
|
||||
orRefreshAdSession = (require(7113) /* metro dependency 7113: SessionAdGenerator */).getOrRefreshAdSession();
|
||||
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||||
defaultImport2.track(AnalyticEvents.CLIENT_AD_HEARTBEAT, {client_ad_session_id: orRefreshAdSession.uuid,
|
||||
client_heartbeat_initialization_timestamp: orRefreshAdSession.createdAtTimestamp,
|
||||
client_heartbeat_version: 3});
|
||||
env0_0.lastHeartbeatTimestamp = value3;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
(importDefault(1216) /* metro dependency 1216: SentryUtilsNative */).addBreadcrumb({'category': 'ad',
|
||||
'message': 'Ad heartbeat called but scheduler not started'});
|
||||
env0_0.heartbeatInterval.stop();
|
||||
}
|
||||
}
|
||||
|
||||
function stopAnalyticHeartbeat() { // fn#100036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:1842, owner: SessionAdManager.stopAnalyticHeartbeat, offset: 0x021dc6d2, size: 150 bytes, params: 1, frame: 16
|
||||
var binding;
|
||||
let value = a0;
|
||||
if (env0_0.schedulerStarted) {
|
||||
binding = env0_0;
|
||||
binding.schedulerStarted = false;
|
||||
binding.lastHeartbeatTimestamp = 0;
|
||||
value = environment.__proto__.__proto__;
|
||||
value = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
|
||||
value.addBreadcrumb({category: 'ad',
|
||||
message: 'Stopping ad session heartbeat: ' + (value !== undefined ? value : env2_12.DEFAULT)});
|
||||
binding.heartbeatInterval.stop();
|
||||
}
|
||||
}
|
||||
|
||||
function SessionAdManagerScheduleHeartbeatTracking() { // fn#100037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:2068, owner: SessionAdManager.scheduleHeartbeatTracking, offset: 0x021dc768, size: 119 bytes, params: 1, frame: 14
|
||||
var value2;
|
||||
var binding;
|
||||
var error;
|
||||
let value = a0;
|
||||
const r5 = value !== undefined ? value : env2_12.DEFAULT;
|
||||
value = environment;
|
||||
if (env0_0.focusedOrForegrounded) {
|
||||
value2 = environment.__proto__.__proto__;
|
||||
if (env2_11 != null) {
|
||||
try {
|
||||
binding = env0_0;
|
||||
binding.startAnalyticHeartbeat();
|
||||
} catch (error) {
|
||||
value = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
|
||||
value.captureException(error);
|
||||
}
|
||||
} else {
|
||||
env0_0.stopAnalyticHeartbeat(r5);
|
||||
}
|
||||
} else {
|
||||
env0_0.stopAnalyticHeartbeat(r5);
|
||||
}
|
||||
}
|
||||
|
||||
function SessionAdManagerHandleLogin() { // fn#100038, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:2236, owner: SessionAdManager.handleLogin, offset: 0x021dc7df, size: 34 bytes, params: 1, frame: 11
|
||||
const binding = env0_0;
|
||||
binding.scheduleHeartbeatTracking();
|
||||
binding.trackHeartbeat(true);
|
||||
}
|
||||
|
||||
function SessionAdManagerHandleLogout() { // fn#100039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:2308, owner: SessionAdManager.handleLogout, offset: 0x021dc801, size: 65 bytes, params: 1, frame: 12
|
||||
const binding = env0_0;
|
||||
const stopAnalyticHeartbeat = binding.stopAnalyticHeartbeat;
|
||||
const value = environment.__proto__.__proto__;
|
||||
const USER_LOGOUT = env2_12.USER_LOGOUT;
|
||||
Reflect.apply(stopAnalyticHeartbeat, binding, [USER_LOGOUT]);
|
||||
(require(7113) /* metro dependency 7113: SessionAdGenerator */).clearAdSession();
|
||||
}
|
||||
|
||||
function handleEnrollmentSuccess() { // fn#100040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:2405, owner: SessionAdManager.handleEnrollmentSuccess, offset: 0x021dc842, size: 40 bytes, params: 1, frame: 12
|
||||
const value = environment.__proto__.__proto__;
|
||||
(require(7113) /* metro dependency 7113: SessionAdGenerator */).getOrRefreshAdSession(true);
|
||||
}
|
||||
|
||||
function SessionAdManagerHandleWindowFocus({focused}) { // fn#100041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:2466, owner: SessionAdManager.handleWindowFocus, offset: 0x021dc86a, size: 50 bytes, params: 2, frame: 11
|
||||
const binding = env0_0;
|
||||
binding.focusedOrForegrounded = focused;
|
||||
const scheduleHeartbeatTracking = binding.scheduleHeartbeatTracking;
|
||||
const WINDOW_FOCUS = env2_12.WINDOW_FOCUS;
|
||||
Reflect.apply(scheduleHeartbeatTracking, binding, [WINDOW_FOCUS]);
|
||||
}
|
||||
|
||||
function SessionAdManagerHandleAppStateUpdate({state}) { // fn#100042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:2576, owner: SessionAdManager.handleAppStateUpdate, offset: 0x021dc89c, size: 63 bytes, params: 2, frame: 12
|
||||
const binding = env0_0;
|
||||
const ACTIVE = AppStates.ACTIVE;
|
||||
binding.focusedOrForegrounded = state === ACTIVE;
|
||||
const scheduleHeartbeatTracking = binding.scheduleHeartbeatTracking;
|
||||
const APP_STATE_UPDATE = env2_12.APP_STATE_UPDATE;
|
||||
Reflect.apply(scheduleHeartbeatTracking, binding, [APP_STATE_UPDATE]);
|
||||
}
|
||||
|
||||
function SessionAdManagerHandleAuthenticationChange() { // fn#100043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13280:2705, owner: SessionAdManager.handleAuthenticationChange, offset: 0x021dc8db, size: 99 bytes, params: 1, frame: 11
|
||||
const value = environment.__proto__.__proto__;
|
||||
if (env2_11 !== AuthenticationStore.getToken()) {
|
||||
(require(7113) /* metro dependency 7113: SessionAdGenerator */).clearAdSession();
|
||||
env0_0.stopAnalyticHeartbeat();
|
||||
}
|
||||
env0_0.scheduleHeartbeatTracking();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/* Metro module 4876; source: modules/analytics_sessions/SessionForegroundUtils.native.tsx; dependencies: [27, 2] */
|
||||
function _fun42751(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#42751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5054:6, offset: 0x01141867, size: 107 bytes, params: 8, frame: 18
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_0 = (require(27) /* metro dependency 27 */).AppState;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/analytics_sessions/SessionForegroundUtils.native.tsx');
|
||||
exports.isForegrounded = function() {
|
||||
return AppState.currentState === 'active';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,569 @@
|
||||
/* Metro module 4875; source: modules/analytics_sessions/SessionHeartbeatScheduler.tsx; dependencies: [5, 4257, 1226, 4795, 4294, 661, 672, 3, 4876, 4877, 1216, 4878, 4880, 683, 4881, 587, 4882, 653, 694, 566, 491, 2] */
|
||||
function _fun42719(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#42719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:6, offset: 0x0114086b, size: 635 bytes, params: 8, frame: 23
|
||||
const env0_0 = require;
|
||||
const trackHeartbeat = function() {
|
||||
return _trackHeartbeat.apply(this, arguments);
|
||||
};
|
||||
const isActive = function() {
|
||||
return buildHeartbeatQOSPayload().active;
|
||||
};
|
||||
const forceDispatchSessionIdUpdate = function() {
|
||||
return _forceDispatchSessionIdUpdate.apply(this, arguments);
|
||||
};
|
||||
const handleFluxInitialized = function() {
|
||||
env0_21 = RTCConnectionStore.getState();
|
||||
env0_22 = require(dependencyMap[8]).isForegrounded();
|
||||
env0_23 = require(dependencyMap[9]).isActiveUserRoute();
|
||||
handleAuthenticationChange();
|
||||
};
|
||||
const closure = function() {
|
||||
return _getSession.apply(this, arguments);
|
||||
};
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
||||
const gatewayConnectionStore = importDefault(4257) /* metro dependency 4257: GatewayConnectionStore */;
|
||||
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
|
||||
const idleStore = importDefault(4795) /* metro dependency 4795: IdleStore */;
|
||||
const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */;
|
||||
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
||||
const env0_8 = constantsModule.AnalyticEvents;
|
||||
const env0_9 = constantsModule.AppStates;
|
||||
const env0_10 = constantsModule.RTCConnectionStates;
|
||||
let Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
||||
const MINUTE = Millis.MINUTE;
|
||||
const env0_11 = 15 * MINUTE;
|
||||
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
||||
const env0_12 = Millis.SECOND;
|
||||
const value6 = new (importDefault(3) /* metro dependency 3: Logger */)('SessionHeartbeatScheduler');
|
||||
object = {state: 'uninitialized'};
|
||||
let env0_21 = rtcConnectionStore.getState();
|
||||
let env0_22 = (require(4876) /* metro dependency 4876: SessionForegroundUtilsNative */).isForegrounded();
|
||||
let env0_23 = (require(4877) /* metro dependency 4877: SessionRouteUtilsNative */).isActiveUserRoute();
|
||||
const env0_24 = authenticationStore.getToken();
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/analytics_sessions/SessionHeartbeatScheduler.tsx');
|
||||
exports.initSessionHeartbeatScheduler = initSessionHeartbeatScheduler;
|
||||
exports.getSession = closure;
|
||||
exports.getActiveSessionUnsafe = getActiveSessionUnsafe;
|
||||
}
|
||||
|
||||
function stopAnalyticsHeartbeat() { // fn#42720, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:486, offset: 0x01140ae6, size: 196 bytes, params: 1, frame: 15
|
||||
var r1;
|
||||
var type;
|
||||
var defaultImport;
|
||||
if (env0_16 == null) {
|
||||
r1 = false;
|
||||
} else {
|
||||
type = env0_16.type;
|
||||
if (type === 'timeout') {
|
||||
global.clearTimeout(env0_16.id);
|
||||
} else if (type === 'interval') {
|
||||
global.clearInterval(env0_16.id);
|
||||
} else {
|
||||
env0_16.type;
|
||||
}
|
||||
r1 = true;
|
||||
}
|
||||
if (r1) {
|
||||
defaultImport = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
|
||||
defaultImport.addBreadcrumb({category: env0_14, message: 'Stopping Analytics Heartbeat'});
|
||||
(require(4878) /* metro dependency 4878: Clickstream */).drainClickstream();
|
||||
}
|
||||
}
|
||||
|
||||
function _trackHeartbeat() { // fn#42722, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:873, offset: 0x01140baa, size: 48 bytes, params: 1, frame: 14
|
||||
return env0_3(_fun42724).apply(this, arguments);
|
||||
}
|
||||
|
||||
function buildHeartbeatQOSPayload() { // fn#42725, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:1662, offset: 0x01140dec, size: 119 bytes, params: 1, frame: 12
|
||||
const items2 = [];
|
||||
if (env0_24 != null && env0_23) {
|
||||
if (env0_22) {
|
||||
items2.push('foregrounded');
|
||||
}
|
||||
if (env0_21 === RTCConnectionStates.RTC_CONNECTED) {
|
||||
items2.push('rtc_connected');
|
||||
}
|
||||
}
|
||||
return {active: items2.length > 0, ver: 29, reasons: items2};
|
||||
}
|
||||
|
||||
function scheduleHeartbeatTracking() { // fn#42727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:1897, offset: 0x01140e78, size: 149 bytes, params: 1, frame: 16
|
||||
(importDefault(1216) /* metro dependency 1216: SentryUtilsNative */).addBreadcrumb({message: 'Heartbeat Track State Parameters Changed. Foregrounded ' + env0_22 + ', Connection State: ' + env0_21});
|
||||
if (isActive()) {
|
||||
startAnalyticsHeartbeat();
|
||||
} else {
|
||||
stopAnalyticsHeartbeat();
|
||||
}
|
||||
const socket = GatewayConnectionStore.getSocket();
|
||||
if (socket != null) {
|
||||
socket.handleActiveStateChange(buildHeartbeatQOSPayload());
|
||||
}
|
||||
}
|
||||
|
||||
function scheduleHeartbeatSkippedTracking() { // fn#42731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:2607, offset: 0x0114100a, size: 62 bytes, params: 1, frame: 15
|
||||
var object2;
|
||||
if (env0_17 == null) {
|
||||
object2 = {};
|
||||
object2.id = global.setInterval(_fun42732, env0_11);
|
||||
object2.type = 'interval';
|
||||
}
|
||||
}
|
||||
|
||||
function validateClientSession(a0) { // fn#42733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:2897, offset: 0x011410d5, size: 143 bytes, params: 2, frame: 20
|
||||
var r1;
|
||||
var r0;
|
||||
const CLIENT_SESSION_STORAGE_VERSION = (require(4882) /* metro dependency 4882: SessionUtils */).CLIENT_SESSION_STORAGE_VERSION;
|
||||
var binding;
|
||||
const value = a0;
|
||||
const value2 = null;
|
||||
if (value2 == value) {
|
||||
r0 = value2;
|
||||
} else {
|
||||
if (value.version === CLIENT_SESSION_STORAGE_VERSION) {
|
||||
r1 = value;
|
||||
} else {
|
||||
binding = env0_15;
|
||||
binding.warn('Throwing away client session with invalid version: ' + value.version + ', expected ' + CLIENT_SESSION_STORAGE_VERSION);
|
||||
r1 = value2;
|
||||
}
|
||||
r0 = r1;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _forceDispatchSessionIdUpdate() { // fn#42735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:3238, offset: 0x01141164, size: 48 bytes, params: 1, frame: 14
|
||||
return env0_3(_fun42737).apply(this, arguments);
|
||||
}
|
||||
|
||||
function handleAuthenticationChange() { // fn#42738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:3508, offset: 0x01141212, size: 116 bytes, params: 1, frame: 13
|
||||
if (env0_24 !== AuthenticationStore.getToken()) {
|
||||
(require(587) /* metro dependency 587: Storage */).Storage.remove(env0_13);
|
||||
env0_20 = {'state': 'loaded', 'session': null};
|
||||
stopAnalyticsHeartbeat();
|
||||
}
|
||||
scheduleHeartbeatTracking();
|
||||
}
|
||||
|
||||
function handleRTCStateChange() { // fn#42739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:3721, offset: 0x01141286, size: 43 bytes, params: 1, frame: 10
|
||||
if (env0_21 !== RTCConnectionStore.getState()) {
|
||||
scheduleHeartbeatTracking();
|
||||
}
|
||||
}
|
||||
|
||||
function handleWindowFocus({focused}) { // fn#42740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:3813, offset: 0x011412b1, size: 38 bytes, params: 2, frame: 10
|
||||
if (env0_22 !== focused) {
|
||||
scheduleHeartbeatTracking();
|
||||
}
|
||||
}
|
||||
|
||||
function handleLocationChange() { // fn#42741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:3894, offset: 0x011412d7, size: 57 bytes, params: 1, frame: 12
|
||||
if (env0_23 !== (require(4877) /* metro dependency 4877: SessionRouteUtilsNative */).isActiveUserRoute()) {
|
||||
scheduleHeartbeatTracking();
|
||||
}
|
||||
}
|
||||
|
||||
function handleAppStateUpdate({state}) { // fn#42742, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:4001, offset: 0x01141310, size: 51 bytes, params: 2, frame: 10
|
||||
const ACTIVE = AppStates.ACTIVE;
|
||||
if (env0_22 !== (state === ACTIVE)) {
|
||||
scheduleHeartbeatTracking();
|
||||
}
|
||||
}
|
||||
|
||||
function _getSession() { // fn#42745, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:4299, offset: 0x011413a0, size: 48 bytes, params: 1, frame: 14
|
||||
return env0_3(_fun42747).apply(this, arguments);
|
||||
}
|
||||
|
||||
function initSessionHeartbeatScheduler() { // fn#42749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:5333, offset: 0x011416db, size: 257 bytes, params: 1, frame: 18
|
||||
(importDefault(1216) /* metro dependency 1216: SentryUtilsNative */).addBreadcrumb({message: 'Initializing SessionHeartbeatScheduler'});
|
||||
RTCConnectionStore.addChangeListener(handleRTCStateChange);
|
||||
AuthenticationStore.addChangeListener(handleAuthenticationChange);
|
||||
const defaultImport2 = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
defaultImport2.subscribe('WINDOW_FOCUS', handleWindowFocus);
|
||||
const defaultImport3 = defaultImport2;
|
||||
defaultImport3.subscribe('APP_STATE_UPDATE', handleAppStateUpdate);
|
||||
const defaultImport4 = defaultImport2;
|
||||
defaultImport4.subscribe('CONNECTION_OPEN', forceDispatchSessionIdUpdate);
|
||||
const sessionRouteUtilsNativeModule = require(4877) /* metro dependency 4877: SessionRouteUtilsNative */;
|
||||
sessionRouteUtilsNativeModule.subscribeToLocationChanges(handleLocationChange);
|
||||
scheduleHeartbeatTracking();
|
||||
scheduleHeartbeatSkippedTracking();
|
||||
const initialized = (importDefault(566) /* metro dependency 566: flux */).initialized;
|
||||
initialized.then(handleFluxInitialized);
|
||||
}
|
||||
|
||||
function getActiveSessionUnsafe() { // fn#42750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:5938, offset: 0x011417dc, size: 139 bytes, params: 1, frame: 15
|
||||
var r1;
|
||||
var r0;
|
||||
var validateClientSessionBinding;
|
||||
var Storage;
|
||||
var value;
|
||||
if (env0_20.state === 'uninitialized') {
|
||||
validateClientSessionBinding = validateClientSession;
|
||||
Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
||||
r1 = validateClientSessionBinding(Storage.get(env0_13));
|
||||
} else {
|
||||
r1 = env0_20.session;
|
||||
}
|
||||
const value3 = null;
|
||||
if (value3 == r1) {
|
||||
r0 = value3;
|
||||
} else {
|
||||
value = require(4882) /* metro dependency 4882: SessionUtils */;
|
||||
r0 = value.isSessionExpired(r1) ? value3 : r1;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function* _fun42724() { // fn#42724, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:926, offset: 0x01140be3, size: 521 bytes, params: 1, frame: 22
|
||||
var r7;
|
||||
var binding;
|
||||
var value7;
|
||||
var captureException;
|
||||
var Error;
|
||||
var binding2;
|
||||
var addBreadcrumb;
|
||||
var object2;
|
||||
var createdAtTimestamp;
|
||||
var object4;
|
||||
var binding3;
|
||||
if (true) {
|
||||
var Date = global.Date;
|
||||
value = Date.now();
|
||||
yield env2_41();
|
||||
var value4 = undefined;
|
||||
if (false) {
|
||||
return value4;
|
||||
}
|
||||
Date = global.Date;
|
||||
if (value4 != null) {
|
||||
binding = env2_1;
|
||||
binding2 = env2_2;
|
||||
value = binding(binding2[10]);
|
||||
addBreadcrumb = value.addBreadcrumb;
|
||||
createdAtTimestamp = value4.createdAtTimestamp;
|
||||
Reflect.apply(addBreadcrumb, value, [{category: env2_14, message: 'Tracking Heartbeat',
|
||||
data: {initialized: createdAtTimestamp}}]);
|
||||
object2 = {};
|
||||
createdAtTimestamp = value4.createdAtTimestamp;
|
||||
object2.client_heartbeat_initialization_timestamp = createdAtTimestamp;
|
||||
object2.client_heartbeat_version = 29;
|
||||
binding = env2_0;
|
||||
value = binding(binding2[12]);
|
||||
copyDataProperties(object2, value.getClientHeartbeatPiggybackProperties(), undefined);
|
||||
binding = env2_6;
|
||||
value = binding.getIdleSince();
|
||||
r7 = value ?? 0;
|
||||
object4 = {};
|
||||
binding = env2_6;
|
||||
object4.is_idle = binding.isIdle();
|
||||
Date = global.Date;
|
||||
object4.idle_duration_ms = Date.now() - r7;
|
||||
binding = env2_6;
|
||||
object4.is_afk = binding.isAFK();
|
||||
binding = env2_6;
|
||||
object4.is_system_suspended = binding.getSystemSuspended();
|
||||
binding = env2_6;
|
||||
object4.is_system_locked = binding.getSystemLocked();
|
||||
copyDataProperties(object2, object4, undefined);
|
||||
binding = env2_1;
|
||||
binding3 = env2_2;
|
||||
value = binding(binding3[13]);
|
||||
value.track(env2_8.CLIENT_HEARTBEAT, object2);
|
||||
env2_19 = global.performance.now();
|
||||
binding = env2_0;
|
||||
value = binding(binding3[11]);
|
||||
value.drainClickstream();
|
||||
} else {
|
||||
value7 = env2_1(env2_2[10]);
|
||||
captureException = value7.captureException;
|
||||
Error = global.Error;
|
||||
value = Date.now() - value;
|
||||
Reflect.apply(captureException, value7,
|
||||
[Error('Null session when tracking session heartbeat. Waited ' + value + 'ms')]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function startAnalyticsHeartbeat() { // fn#42728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:2102, owner: scheduleHeartbeatTracking.startAnalyticsHeartbeat, offset: 0x01140f0d, size: 180 bytes, params: 1, frame: 20
|
||||
var r5;
|
||||
var value2;
|
||||
if (env1_16 == null) {
|
||||
value2 = 0;
|
||||
r5 = value2 === env1_19 ? value2 : env1_11 - (global.performance.now() - env1_19);
|
||||
(importDefault(1216) /* metro dependency 1216: SentryUtilsNative */).addBreadcrumb({message: 'Received Last Heartbeat Event Timestamp. Time Until Next Heartbeat: ' + r5 / 1000 + ' seconds. Scheduling Heartbeat'});
|
||||
({type: 'timeout'}).id = global.setTimeout(_fun42729, r5);
|
||||
}
|
||||
}
|
||||
|
||||
function _fun42732() { // fn#42732, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:2680, offset: 0x01141048, size: 141 bytes, params: 1, frame: 14
|
||||
var defaultImport;
|
||||
if (env1_24 != null && (require(4881) /* metro dependency 4881: SkippedClientHeartbeatExperiment */).shouldLogClientHeartbeatSkipped()) {
|
||||
if (!(global.performance.now() - env1_19 <= env1_11)) {
|
||||
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||||
defaultImport.track(AnalyticEvents.CLIENT_HEARTBEAT_SKIPPED, {client_heartbeat_version: 29});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function* _fun42737() { // fn#42737, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:3319, offset: 0x0114119d, size: 117 bytes, params: 1, frame: 20
|
||||
var socket;
|
||||
if (true) {
|
||||
value = environment.__proto__.__proto__;
|
||||
yield env2_41(false);
|
||||
var value3 = undefined;
|
||||
if (false) {
|
||||
return value3;
|
||||
}
|
||||
if (value3 != null) {
|
||||
socket = env2_4.getSocket();
|
||||
if (socket != null) {
|
||||
socket.handleUpdateTimeSpentSessionId(value3.createdAtTimestamp, value3.uuid,
|
||||
env2_0(env2_2[17]).clientLaunchId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function _fun42747() { // fn#42747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:4344, offset: 0x011413e2, size: 259 bytes, params: 1, frame: 18
|
||||
var r1;
|
||||
var uuid;
|
||||
var r5;
|
||||
var r6;
|
||||
var session;
|
||||
var binding;
|
||||
var binding2;
|
||||
var binding3;
|
||||
var property;
|
||||
var Storage;
|
||||
var getAfterRefresh;
|
||||
var binding4;
|
||||
var value7;
|
||||
var error;
|
||||
var captureException;
|
||||
let value = a0;
|
||||
if (false) {
|
||||
return undefined;
|
||||
}
|
||||
const value4 = undefined;
|
||||
reducibleJoin3: while (true) {
|
||||
if (value !== value4) {
|
||||
r1 = value;
|
||||
break reducibleJoin3;
|
||||
}
|
||||
value = true;
|
||||
r1 = value;
|
||||
break reducibleJoin3;
|
||||
}
|
||||
var env0_1;
|
||||
await value4;
|
||||
if (false) {
|
||||
return undefined;
|
||||
}
|
||||
value = null;
|
||||
let state = env2_20.state;
|
||||
reducibleJoin9: while (true) {
|
||||
if (state !== 'loaded') {
|
||||
r5 = value;
|
||||
break reducibleJoin9;
|
||||
}
|
||||
session = env2_20.session;
|
||||
reducibleJoin8: while (true) {
|
||||
if (value == session) {
|
||||
uuid = value4;
|
||||
break reducibleJoin8;
|
||||
}
|
||||
uuid = session.uuid;
|
||||
break reducibleJoin8;
|
||||
}
|
||||
r5 = uuid;
|
||||
break reducibleJoin9;
|
||||
}
|
||||
reducibleJoin11: while (true) {
|
||||
reduciblePort34: while (true) {
|
||||
exceptionLanding33: while (true) {
|
||||
try {
|
||||
binding = env2_20;
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
break reducibleJoin11;
|
||||
}
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[10]);
|
||||
captureException = value.captureException;
|
||||
Reflect.apply(captureException, value, [error]);
|
||||
break reduciblePort34;
|
||||
}
|
||||
return _fun42748();
|
||||
}
|
||||
try {
|
||||
state = binding.state;
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
try {
|
||||
value = state === 'uninitialized';
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
if (value) {
|
||||
try {
|
||||
binding = env2_32;
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
try {
|
||||
binding2 = env2_0;
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
try {
|
||||
binding3 = env2_2;
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
try {
|
||||
property = binding3[15];
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
try {
|
||||
value = binding2(property);
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
try {
|
||||
Storage = value.Storage;
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
try {
|
||||
getAfterRefresh = Storage.getAfterRefresh;
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
try {
|
||||
binding4 = env2_13;
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
try {
|
||||
value = Reflect.apply(getAfterRefresh, Storage, [binding4]);
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
await value;
|
||||
try {
|
||||
value = undefined;
|
||||
value7 = false;
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
if (value7) {
|
||||
return value;
|
||||
}
|
||||
try {
|
||||
value = binding(value);
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
r6 = value;
|
||||
} else {
|
||||
try {
|
||||
binding = env2_20;
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
try {
|
||||
session = binding.session;
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
r6 = session;
|
||||
}
|
||||
try {
|
||||
env0_1 = r6;
|
||||
} catch (error) {
|
||||
break exceptionLanding33;
|
||||
}
|
||||
return _fun42748();
|
||||
}
|
||||
|
||||
function _fun42729() { // fn#42729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:2363, offset: 0x01140fc1, size: 58 bytes, params: 1, frame: 15
|
||||
trackHeartbeat();
|
||||
({type: 'interval'}).id = global.setInterval(function() {
|
||||
trackHeartbeat();
|
||||
}, env2_11);
|
||||
}
|
||||
|
||||
function _fun42748() { // fn#42748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5053:4585, offset: 0x011414e5, size: 502 bytes, params: 1, frame: 21
|
||||
var r6;
|
||||
var object2;
|
||||
var binding2;
|
||||
var binding3;
|
||||
var binding4;
|
||||
var property;
|
||||
var value9;
|
||||
var Storage;
|
||||
var set;
|
||||
var binding5;
|
||||
var error;
|
||||
const Date = global.Date;
|
||||
let value = Date.now();
|
||||
const value3 = env3_29();
|
||||
let binding = env0_1;
|
||||
if (value3) {
|
||||
if (binding == null || env3_0(env3_2[16]).isSessionExpired(env0_1)) {
|
||||
object2 = {};
|
||||
binding = env3_0;
|
||||
binding2 = env3_2;
|
||||
object2.uuid = binding(binding2[20]).v4();
|
||||
object2.createdAtTimestamp = value;
|
||||
object2.lastUsedTimestamp = value;
|
||||
object2.version = binding(binding2[16]).CLIENT_SESSION_STORAGE_VERSION;
|
||||
env0_1 = object2;
|
||||
env3_18 = 0;
|
||||
}
|
||||
env0_1.lastUsedTimestamp = value;
|
||||
binding = env0_1;
|
||||
value = global.performance.now();
|
||||
if (!(value - env3_18 < env3_12)) {
|
||||
try {
|
||||
binding3 = env3_0;
|
||||
binding4 = env3_2;
|
||||
property = binding4[15];
|
||||
value9 = binding3(property);
|
||||
Storage = value9.Storage;
|
||||
set = Storage.set;
|
||||
binding5 = env3_13;
|
||||
Reflect.apply(set, Storage, [binding5, binding]);
|
||||
env3_18 = value;
|
||||
} catch (error) {
|
||||
binding = env3_1;
|
||||
value = binding(env3_2[10]);
|
||||
value.captureException(error);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
value = binding != null;
|
||||
if (value) {
|
||||
value = env3_0(env3_2[16]);
|
||||
value = value.isSessionExpired(env0_1);
|
||||
r6 = value;
|
||||
} else {
|
||||
r6 = value;
|
||||
}
|
||||
env0_1 = r6 ? null : env0_1;
|
||||
}
|
||||
object2 = {state: 'loaded', session: env0_1};
|
||||
if (env0_1 != null && env0_2 !== env0_1.uuid && env0_0) {
|
||||
value = env3_4.getSocket();
|
||||
if (value != null) {
|
||||
value.handleUpdateTimeSpentSessionId(env0_1.createdAtTimestamp, env0_1.uuid,
|
||||
env3_0(env3_2[17]).clientLaunchId);
|
||||
}
|
||||
}
|
||||
return env0_1;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/* Metro module 4877; source: modules/analytics_sessions/SessionRouteUtils.native.tsx; dependencies: [2] */
|
||||
function _fun42753(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#42753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5055:6, offset: 0x011418e9, size: 96 bytes, params: 8, frame: 16
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/analytics_sessions/SessionRouteUtils.native.tsx');
|
||||
exports.isActiveUserRoute = function() {
|
||||
return true;
|
||||
};
|
||||
exports.subscribeToLocationChanges = function() {
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/* Metro module 4882; source: modules/analytics_sessions/SessionUtils.tsx; dependencies: [672, 2] */
|
||||
function _fun42787(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#42787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5060:6, offset: 0x011421a3, size: 148 bytes, params: 8, frame: 18
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
||||
const MINUTE = Millis.MINUTE;
|
||||
const value = 30 * MINUTE;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/analytics_sessions/SessionUtils.tsx');
|
||||
exports.SESSION_IDLE_TIMEOUT_MILLIS = value;
|
||||
exports.CLIENT_SESSION_STORAGE_VERSION = 1;
|
||||
exports.isSessionExpired = isSessionExpired_42788;
|
||||
exports.timestampOrZero = function(a0) {
|
||||
return a0 != null ? (0, global.Number)(a0) : 0;
|
||||
};
|
||||
}
|
||||
|
||||
function isSessionExpired_42788({lastUsedTimestamp}) { // fn#42788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5060:286, offset: 0x01142237, size: 49 bytes, params: 2, frame: 10
|
||||
let value = env0_0 + lastUsedTimestamp;
|
||||
const Date = global.Date;
|
||||
value -= Date.now();
|
||||
return value <= 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/* Metro module 4881; source: modules/analytics_sessions/SkippedClientHeartbeatExperiment.tsx; dependencies: [1854, 2] */
|
||||
function _fun42785(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#42785, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5059:6, offset: 0x011420e1, size: 158 bytes, params: 8, frame: 21
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_0 = (require(1854) /* metro dependency 1854: apex */).createApexExperiment({'name': '2026-02-client-heartbeat-skipped',
|
||||
'kind': 'user', defaultConfig: {logHeartbeatSkipped: false}, variations: {[1]: {logHeartbeatSkipped: true}}});
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/analytics_sessions/SkippedClientHeartbeatExperiment.tsx');
|
||||
exports.shouldLogClientHeartbeatSkipped = shouldLogClientHeartbeatSkipped;
|
||||
}
|
||||
|
||||
function shouldLogClientHeartbeatSkipped() { // fn#42786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5059:392, offset: 0x0114217f, size: 36 bytes, params: 1, frame: 12
|
||||
const binding = env0_0;
|
||||
const getConfig = binding.getConfig;
|
||||
return Reflect.apply(getConfig, binding, [{location: 'shouldLogClientHeartbeatSkipped'}]).logHeartbeatSkipped;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user