@scrypted/client
Advanced tools
Comparing version 1.1.5 to 1.1.6
@@ -30,13 +30,15 @@ "use strict"; | ||
function timeoutPromise(timeout, promise) { | ||
return new Promise((resolve, reject) => { | ||
return new Promise(async (resolve, reject) => { | ||
setTimeout(() => reject(new TimeoutError(promise)), timeout); | ||
const t = setTimeout(() => reject(new TimeoutError(promise)), timeout); | ||
promise.then(v => { | ||
clearTimeout(t); | ||
try { | ||
const v = await promise; | ||
resolve(v); | ||
}); | ||
promise.catch(e => { | ||
} | ||
catch (e) { | ||
reject(e); | ||
} | ||
finally { | ||
clearTimeout(t); | ||
reject(e); | ||
}); | ||
} | ||
}); | ||
@@ -43,0 +45,0 @@ } |
@@ -217,3 +217,3 @@ "use strict"; | ||
try { | ||
// console.log(`${type} trickled candidate:`, candidate.sdpMLineIndex, candidate.candidate); | ||
console.log(`${type} trickled candidate:`, candidate.sdpMLineIndex, candidate.candidate); | ||
await session.addIceCandidate(candidate); | ||
@@ -220,0 +220,0 @@ } |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EventRegistry = exports.EventListenerRegisterImpl = void 0; | ||
const types_1 = require("@scrypted/types"); | ||
const crypto_1 = __importDefault(require("crypto")); | ||
class EventListenerRegisterImpl { | ||
@@ -48,2 +52,3 @@ removeListener; | ||
const eventDetails = { | ||
eventId: crypto_1.default.randomBytes(8).toString("base64"), | ||
changed, | ||
@@ -50,0 +55,0 @@ eventInterface, |
@@ -310,6 +310,6 @@ "use strict"; | ||
if (eventDetails.property) { | ||
remote.notify(id, eventDetails.eventTime, eventDetails.eventInterface, eventDetails.property, getSystemState()[id]?.[eventDetails.property], eventDetails.changed); | ||
remote.notify(id, eventDetails.eventTime, eventDetails.eventInterface, eventDetails.property, getSystemState()[id]?.[eventDetails.property], eventDetails.changed).catch(() => { }); | ||
} | ||
else { | ||
remote.notify(id, eventDetails.eventTime, eventDetails.eventInterface, eventDetails.property, eventData, eventDetails.changed); | ||
remote.notify(id, eventDetails.eventTime, eventDetails.eventInterface, eventDetails.property, eventData, eventDetails.changed).catch(() => { }); | ||
} | ||
@@ -316,0 +316,0 @@ }); |
@@ -63,4 +63,9 @@ "use strict"; | ||
set(target, p, value, receiver) { | ||
if (p === RpcPeer.finalizerIdSymbol) | ||
if (p === RpcPeer.finalizerIdSymbol) { | ||
this.entry.finalizerId = value; | ||
} | ||
else { | ||
this.proxyProps ||= {}; | ||
this.proxyProps[p] = value; | ||
} | ||
return true; | ||
@@ -206,2 +211,3 @@ } | ||
}); | ||
this.killed.catch(() => { }); | ||
} | ||
@@ -387,2 +393,4 @@ createPendingResult(cb) { | ||
async handleMessage(message, deserializationContext) { | ||
if (Object.isFrozen(this.pendingResults)) | ||
return; | ||
try { | ||
@@ -389,0 +397,0 @@ switch (message.type) { |
{ | ||
"name": "@scrypted/client", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/packages/client/src/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
337207
3537