querysub 0.484.0 → 0.486.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.484.0",
3
+ "version": "0.486.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",
@@ -182,7 +182,9 @@ class ValidStateComputer {
182
182
  }
183
183
 
184
184
  authorityStorage.ingestValues(notOurValues, { doNotArchive });
185
- authorityStorage.ingestValues(ourValues, { doNotArchive });
185
+ let newOurValues = ourValues.filter(x => !authorityStorage.getValueExactMaybeRejected(x.path, x.time));
186
+ // Only ingest the values that are new to us. Otherwise, we'd be accepting the valid state from somebody else, and we're the authority, so we just shouldn't do that.
187
+ authorityStorage.ingestValues(newOurValues, { doNotArchive });
186
188
 
187
189
 
188
190
  let loopCount = 0;
@@ -384,6 +386,11 @@ class ValidStateComputer {
384
386
  // Don't decide; leave pathValue.valid and storage alone. Schedule retry at outer level.
385
387
  for (let pathValue of valueGroup) {
386
388
  deferred.push(pathValue);
389
+ console.info(`Deferring value valid changing`, {
390
+ path: pathValue.path,
391
+ timeId: pathValue.time.time,
392
+ timeIdFull: pathValue.time,
393
+ });
387
394
  }
388
395
  continue;
389
396
  }
@@ -414,11 +421,11 @@ class ValidStateComputer {
414
421
  }
415
422
  */
416
423
  // IMPORTANT! This means if it didn't previously exist and it's presently rejected, we count that as a change, as it this is going from undefined to false. This is actually very useful, as a lot of places want to know if a write is rejected, so they can display it in the UI for the developer.
417
- if (valid === prevValidState) continue;
424
+ if (valid === prevValidState && pathValue.valid === valid) continue;
418
425
 
419
426
  // NOTE: We might remove this logging later as it's pretty heavy, but right now we still have bugs somewhere here.
420
427
  {
421
- console.info(`Changed valid state ${JSON.stringify(prevValidState)} to ${JSON.stringify(valid)}`, {
428
+ console.info(`Changed valid state ${JSON.stringify(prevValidState)} to ${JSON.stringify(valid)} (and path is ${JSON.stringify(pathValue.valid)})`, {
422
429
  path: pathValue.path,
423
430
  timeId: pathValue.time.time,
424
431
  timeIdFull: pathValue.time,