querysub 0.308.0 → 0.309.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "querysub",
3
- "version": "0.308.0",
3
+ "version": "0.309.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
@@ -1303,7 +1303,7 @@ class PathWatcher {
1303
1303
  }
1304
1304
  if (history.length === 0) {
1305
1305
  // We always have to send something, or the client won't know when they are ready to show the data!
1306
- initialValues.add({ path, value: undefined, canGCValue: true, valid: true, time: epochTime, locks: [], lockCount: 0, event: false });
1306
+ initialValues.add({ path, value: undefined, canGCValue: true, isTransparent: true, valid: true, time: epochTime, locks: [], lockCount: 0, event: false });
1307
1307
  }
1308
1308
  }
1309
1309
  this.triggerLatestWatcher(
@@ -1467,20 +1467,9 @@ export class PathValueProxyWatcher {
1467
1467
  continue;
1468
1468
  }
1469
1469
  if (!prefixes.some(x => value.path.startsWith(x))) continue;
1470
- let oldReadCheck = !!(
1471
- value.canGCValue
1472
- || pathValueSerializer.getPathValue(value) === specialObjectWriteValue
1473
- );
1474
1470
  let newReadCheck = !!value.isTransparent;
1475
- if (oldReadCheck !== newReadCheck) {
1476
- console.error(`Old read check ${oldReadCheck} !== newReadCheck ${newReadCheck} for ${value.path}, canGCValue: ${value.canGCValue}, isTransparent: ${value.isTransparent}`);
1477
- // IMPORTANT! IF WE HIT THIS ASSERT, DEBUG IT RIGHT NOW!
1478
- // - I updated the read check to use isTransparent. BUT... I'm not sure
1479
- // this is correct. This WILL break if we add any new isTransparent values,
1480
- // so this update is requried, but... this code is so old, that I'm not
1481
- // sure updating it like this is safe.
1482
- // - Double check the the value at `pathValueSerializer.getPathValue(value)`
1483
- // and value, and see if it should act as a tranparent value or not.
1471
+ if (value.canGCValue && !value.isTransparent) {
1472
+ console.error(`Value is GCable, but not transparent. We likely forgot to set isTransparent when setting canGCValue. Path ${value.path}, value: ${String(pathValueSerializer.getPathValue(value))}`);
1484
1473
  debugbreak(2);
1485
1474
  debugger;
1486
1475
  }
@@ -450,7 +450,7 @@ export class QuerysubControllerBase {
450
450
  // Send them undefined values at epochTime
451
451
  // NOTE: We COULD send at time Date.now(), which would allow clobbering any existing values. This might
452
452
  // make the UI look cleaner (instead of showing stale values, it shows nothing)?
453
- let undefinedValues: PathValue[] = newPathsNotAllowed.map(path => ({ path, value: undefined, canGCValue: true, time: epochTime, locks: [], lockCount: 0, valid: true, event: false }));
453
+ let undefinedValues: PathValue[] = newPathsNotAllowed.map(path => ({ path, value: undefined, canGCValue: true, isTransparent: true, time: epochTime, locks: [], lockCount: 0, valid: true, event: false }));
454
454
 
455
455
  diskLog(`Disallowing PathValue watches due to disallowed permissions`, { count: newPathsNotAllowed.length, callerId });
456
456