core-3nweb-client-lib 0.27.10 → 0.27.11

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.
@@ -58,7 +58,9 @@ WHERE ${column.msgId}=$${column.msgId}`;
58
58
  function listMsgInfos(db, fromTS) {
59
59
  let result;
60
60
  if (fromTS) {
61
- result = db.exec(`SELECT ${column.msgId}, ${column.msgType}, ${column.deliveryTS} FROM ${indexTab} WHERE ${column.deliveryTS}>$fromTS`, { '$fromTS': fromTS });
61
+ result = db.exec(`SELECT ${column.msgId}, ${column.msgType}, ${column.deliveryTS} FROM ${indexTab} WHERE ${column.deliveryTS}>$fromTS`, {
62
+ '$fromTS': fromTS
63
+ });
62
64
  }
63
65
  else {
64
66
  result = db.exec(`SELECT ${column.msgId}, ${column.msgType}, ${column.deliveryTS} FROM ${indexTab}`);
@@ -217,8 +219,7 @@ class RecordsInSQL {
217
219
  }
218
220
  async getKeyFor(msgId, deliveryTS) {
219
221
  const db = await this.getIndexWith(deliveryTS);
220
- const result = db.db.exec(`SELECT
221
- ${column.key}, ${column.keyStatus}, ${column.mainObjHeaderOfs}
222
+ const result = db.db.exec(`SELECT ${column.key}, ${column.keyStatus}, ${column.mainObjHeaderOfs}
222
223
  FROM ${indexTab}
223
224
  WHERE ${column.msgId}=$${column.msgId}`, { [`$${column.msgId}`]: msgId });
224
225
  if (result.length === 0) {
@@ -221,6 +221,9 @@ class ClientsSideImpl {
221
221
  this.weakRefs.add(clientRef);
222
222
  clientRef.addCallback(this.makeClientDropCB(clientRef, srvRef));
223
223
  this.srvRefs.set(o, srvRef);
224
+ if (global['runningInIsolatedContext']) {
225
+ o['--srv-ref'] = srvRef;
226
+ }
224
227
  }
225
228
  makeClientDropCB(clientRef, srvRef) {
226
229
  return () => {
@@ -235,12 +238,23 @@ class ClientsSideImpl {
235
238
  this.sendMsg({ headers: { msgType: 'drop', path: srvRef.path } });
236
239
  }
237
240
  srvRefOf(clientObj) {
238
- const srvRef = this.srvRefs.get(clientObj);
239
- if (srvRef) {
240
- return srvRef;
241
+ if (global['runningInIsolatedContext']) {
242
+ const srvRef = clientObj['--srv-ref'];
243
+ if (srvRef) {
244
+ return srvRef;
245
+ }
246
+ else {
247
+ throw new Error(`Given object has never been registered as one referencing respective object in the core`);
248
+ }
241
249
  }
242
250
  else {
243
- throw (0, connector_1.makeIPCException)({ 'objectNotFound': true });
251
+ const srvRef = this.srvRefs.get(clientObj);
252
+ if (srvRef) {
253
+ return srvRef;
254
+ }
255
+ else {
256
+ throw (0, connector_1.makeIPCException)({ 'objectNotFound': true });
257
+ }
244
258
  }
245
259
  }
246
260
  listObj(path) {