580 lines
27 KiB
TypeScript
580 lines
27 KiB
TypeScript
/* 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] */
|
|
import Logger from '../debug/Logger.tsx'; /* Metro dependency 3 */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import Dispatcher from '../../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import SentryUtilsNative from '../../utils/SentryUtils.native.tsx'; /* Metro dependency 1216 */
|
|
import AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
|
|
import GatewayConnectionStore from '../gateway/GatewayConnectionStore.tsx'; /* Metro dependency 4257 */
|
|
import RTCConnectionStore from '../../stores/RTCConnectionStore.tsx'; /* Metro dependency 4294 */
|
|
import IdleStore from '../../stores/IdleStore.tsx'; /* Metro dependency 4795 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as SessionForegroundUtilsNativeModule from './SessionForegroundUtils.native.tsx'; /* Metro dependency 4876 */
|
|
import * as SessionRouteUtilsNativeModule from './SessionRouteUtils.native.tsx'; /* Metro dependency 4877 */
|
|
import * as SessionUtilsModule from './SessionUtils.tsx'; /* Metro dependency 4882 */
|
|
|
|
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});
|
|
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 (Logger)('SessionHeartbeatScheduler');
|
|
object = {state: 'uninitialized'};
|
|
let env0_21 = RTCConnectionStore.getState();
|
|
let env0_22 = (SessionForegroundUtilsNativeModule).isForegrounded();
|
|
let env0_23 = (SessionRouteUtilsNativeModule).isActiveUserRoute();
|
|
const env0_24 = AuthenticationStore.getToken();
|
|
(FileImportTrackerModule).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 Module00005(_fun42724).apply(this, arguments);
|
|
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 object;
|
|
var createdAtTimestamp;
|
|
var object3;
|
|
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}}]);
|
|
object = {};
|
|
createdAtTimestamp = value4.createdAtTimestamp;
|
|
object.client_heartbeat_initialization_timestamp = createdAtTimestamp;
|
|
object.client_heartbeat_version = 29;
|
|
binding = env2_0;
|
|
value = binding(binding2[12]);
|
|
copyDataProperties(object, value.getClientHeartbeatPiggybackProperties(), undefined);
|
|
binding = env2_6;
|
|
value = binding.getIdleSince();
|
|
r7 = value ?? 0;
|
|
object3 = {};
|
|
binding = env2_6;
|
|
object3.is_idle = binding.isIdle();
|
|
Date = global.Date;
|
|
object3.idle_duration_ms = Date.now() - r7;
|
|
binding = env2_6;
|
|
object3.is_afk = binding.isAFK();
|
|
binding = env2_6;
|
|
object3.is_system_suspended = binding.getSystemSuspended();
|
|
binding = env2_6;
|
|
object3.is_system_locked = binding.getSystemLocked();
|
|
copyDataProperties(object, object3, undefined);
|
|
binding = env2_1;
|
|
binding3 = env2_2;
|
|
value = binding(binding3[13]);
|
|
value.track(env2_8.CLIENT_HEARTBEAT, object);
|
|
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 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
|
|
(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 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 _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 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 object;
|
|
if (env0_17 == null) {
|
|
object = {};
|
|
object.id = global.setInterval(_fun42732, env0_11);
|
|
object.type = 'interval';
|
|
}
|
|
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 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 = (SessionUtilsModule).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 Module00005(_fun42737).apply(this, arguments);
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
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 Module00005(_fun42747).apply(this, arguments);
|
|
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 _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 object;
|
|
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)) {
|
|
object = {};
|
|
binding = env3_0;
|
|
binding2 = env3_2;
|
|
object.uuid = binding(binding2[20]).v4();
|
|
object.createdAtTimestamp = value;
|
|
object.lastUsedTimestamp = value;
|
|
object.version = binding(binding2[16]).CLIENT_SESSION_STORAGE_VERSION;
|
|
env0_1 = object;
|
|
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;
|
|
}
|
|
object = {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;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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
|
|
(SentryUtilsNative).addBreadcrumb({message: 'Initializing SessionHeartbeatScheduler'});
|
|
const rtcConnectionStoreBinding = RTCConnectionStore;
|
|
rtcConnectionStoreBinding.addChangeListener(handleRTCStateChange);
|
|
const authenticationStoreBinding = AuthenticationStore;
|
|
authenticationStoreBinding.addChangeListener(handleAuthenticationChange);
|
|
const defaultImport2 = Dispatcher;
|
|
defaultImport2.subscribe('WINDOW_FOCUS', handleWindowFocus);
|
|
const defaultImport3 = defaultImport2;
|
|
defaultImport3.subscribe('APP_STATE_UPDATE', handleAppStateUpdate);
|
|
const defaultImport4 = defaultImport2;
|
|
defaultImport4.subscribe('CONNECTION_OPEN', forceDispatchSessionIdUpdate);
|
|
SessionRouteUtilsNativeModule.subscribeToLocationChanges(handleLocationChange);
|
|
scheduleHeartbeatTracking();
|
|
scheduleHeartbeatSkippedTracking();
|
|
const initialized = (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;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun42719, 4875, [5, 4257, 1226, 4795, 4294, 661, 672, 3, 4876, 4877, 1216, 4878, 4880, 683, 4881, 587,
|
|
4882, 653, 694, 566, 491,
|
|
2]) /* metro module 4875, dependencies: [5, 4257, 1226, 4795, 4294, 661, 672, 3, 4876, 4877, 1216, 4878, 4880, 683, 4881, 587, 4882, 653, 694, 566, 491, 2] */;
|