@newtonschool/react_proctoring_library 0.0.133-beta.0 → 0.0.133-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -290,7 +290,25 @@ const setupDeviceStatusListeners = _ref2 => {
|
|
|
290
290
|
if (isConnected && typeof lastBeat === 'number' && now - lastBeat > OTHER_DEVICE_HEARTBEAT_TIMEOUT_MS) {
|
|
291
291
|
update(otherDeviceStatusRef, {
|
|
292
292
|
connected: false
|
|
293
|
-
}).then(() => {
|
|
293
|
+
}).then(() => {
|
|
294
|
+
const isMarkingSecondaryDeviceStale = !isSecondaryDevice;
|
|
295
|
+
if (!isMarkingSecondaryDeviceStale) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
(0, _proctoringDebugUtils.emitProctoringDebugLog)('primary_marked_secondary_inactive_due_to_stale_heartbeat', {
|
|
299
|
+
deviceType: 'primary',
|
|
300
|
+
userUuid,
|
|
301
|
+
now,
|
|
302
|
+
timeoutMs: OTHER_DEVICE_HEARTBEAT_TIMEOUT_MS,
|
|
303
|
+
heartbeatDiffMs: now - lastBeat,
|
|
304
|
+
payload: {
|
|
305
|
+
connected: false,
|
|
306
|
+
source: 'stale_other_device',
|
|
307
|
+
otherDeviceType: 'secondary',
|
|
308
|
+
otherDeviceStatus: getObservedStatusPayload(otherDeviceStatus, now)
|
|
309
|
+
}
|
|
310
|
+
}, firebaseClient);
|
|
311
|
+
}).catch(otherErr => {
|
|
294
312
|
const isMarkingSecondaryDeviceStale = !isSecondaryDevice;
|
|
295
313
|
if (!isMarkingSecondaryDeviceStale) {
|
|
296
314
|
return;
|
package/package.json
CHANGED