querysub 0.397.0 → 0.398.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.397.0",
3
+ "version": "0.398.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",
@@ -1,5 +1,6 @@
1
1
  import { lazy } from "socket-function/src/caching";
2
2
  import { Archives } from "./archives";
3
+ import { green } from "socket-function/src/formatting/logColors";
3
4
 
4
5
  export type ArchiveT<T> = {
5
6
  get(key: string): Promise<T | undefined>;
@@ -26,10 +27,14 @@ export function archiveJSONT<T>(archives: () => Archives): ArchiveT<T> {
26
27
  return JSON.parse(buffer.toString()) as T;
27
28
  }
28
29
  async function set(key: string, value: T) {
29
- await archives().set(key, Buffer.from(JSON.stringify(value)));
30
+ let a = archives();
31
+ console.log(`In archiveJSONT ${a.getDebugName()}, setting ${key} to ${JSON.stringify(value)}`);
32
+ await a.set(key, Buffer.from(JSON.stringify(value)));
30
33
  }
31
34
  async function deleteFnc(key: string) {
32
- await archives().del(key);
35
+ let a = archives();
36
+ console.log(`In archiveJSONT ${a.getDebugName()}, deleting ${key}`);
37
+ await a.del(key);
33
38
  }
34
39
  async function keys() {
35
40
  return (await archives().find("")).map(value => value.toString());
@@ -148,7 +148,7 @@ export class LogDatumRenderer extends qreact.Component<{
148
148
  e.stopPropagation();
149
149
  }
150
150
  Querysub.onCommitFinished(async () => {
151
- await this.manager.updateTimeout(timedOutMatches[0].id, Infinity);
151
+ await this.manager.updateTimeout(timedOutMatches[0].id, Number.MAX_SAFE_INTEGER);
152
152
  });
153
153
  }}
154
154
  >
@@ -295,7 +295,7 @@ export class ErrorNotificationPage extends qreact.Component {
295
295
  if (pattern) {
296
296
  this.state.newNotABugPattern = pattern;
297
297
  Querysub.onCommitFinished(async () => {
298
- await this.manager.addSuppression(pattern, Infinity);
298
+ await this.manager.addSuppression(pattern, Number.MAX_SAFE_INTEGER);
299
299
  Querysub.commit(() => {
300
300
  this.state.newNotABugPattern = "";
301
301
  });
@@ -371,7 +371,7 @@ class SuppressionItem extends qreact.Component<{
371
371
  }
372
372
 
373
373
  let timeoutText: preact.ComponentChild;
374
- if (suppression.timeout === Infinity) {
374
+ if (suppression.timeout >= Number.MAX_SAFE_INTEGER) {
375
375
  timeoutText = "Never expires";
376
376
  } else if (suppression.timeout > Date.now()) {
377
377
  timeoutText = <span>Expires <b>{formatTime(suppression.timeout - Date.now())}</b></span>;
@@ -406,7 +406,7 @@ class SuppressionItem extends qreact.Component<{
406
406
  hue={120}
407
407
  onClick={() => {
408
408
  Querysub.onCommitFinished(async () => {
409
- await this.manager.updateTimeout(suppression.id, Infinity);
409
+ await this.manager.updateTimeout(suppression.id, Number.MAX_SAFE_INTEGER);
410
410
  });
411
411
  }}
412
412
  >