querysub 0.396.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.396.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",
@@ -118,7 +118,7 @@ class ArchivesDisk {
118
118
  if (dir.endsWith(":")) break;
119
119
  let files = await fs.promises.readdir(this.LOCAL_ARCHIVE_FOLDER + dir);
120
120
  if (files.length > 0) break;
121
- await fs.promises.rmdir(this.LOCAL_ARCHIVE_FOLDER + dir);
121
+ await fs.promises.rm(this.LOCAL_ARCHIVE_FOLDER + dir, { recursive: true });
122
122
  }
123
123
  } catch { }
124
124
  }
@@ -176,7 +176,7 @@ class ArchivesDisk {
176
176
  } catch { }
177
177
  if (files.length === 0) {
178
178
  try {
179
- await fs.promises.rmdir(dir);
179
+ await fs.promises.rm(dir, { recursive: true });
180
180
  } catch { }
181
181
  }
182
182
  }
@@ -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());
@@ -170,7 +170,7 @@ let moduleResolver = async (spec: {
170
170
 
171
171
  // Remove any previous attempt to sync it
172
172
  if (fs.existsSync(repoPath)) {
173
- await fs.promises.rmdir(repoPath, { recursive: true });
173
+ await fs.promises.rm(repoPath, { recursive: true });
174
174
  }
175
175
  // Clone it
176
176
  await executeCommand("git", ["clone", gitURL, repoPath]);
@@ -182,7 +182,7 @@ let moduleResolver = async (spec: {
182
182
  // Delete querysub, and replace it with a symlink. Otherwise the synchronization code
183
183
  // will run again, and a lot of setup code will run again, etc, and nothing will work correctly.
184
184
  let querysubPath = repoPath + "node_modules/querysub";
185
- await fs.promises.rmdir(querysubPath, { recursive: true });
185
+ await fs.promises.rm(querysubPath, { recursive: true });
186
186
 
187
187
  let actualQuerysubPath = path.resolve("./node_modules/querysub");
188
188
  await fs.promises.symlink(actualQuerysubPath, querysubPath, "junction");
@@ -600,7 +600,7 @@ const ensureGitSynced = measureWrap(async function ensureGitSynced(config: {
600
600
  await setGitRef(config);
601
601
  } catch (e: any) {
602
602
  console.warn(`Failed to set git ref, trying to delete and clone again (${config.gitFolder}): ${e.stack}`);
603
- await fs.promises.rmdir(config.gitFolder, { recursive: true });
603
+ await fs.promises.rm(config.gitFolder, { recursive: true });
604
604
  await runPromise(`git clone ${config.repoUrl} ${config.gitFolder}`);
605
605
  await setGitRef(config);
606
606
  }
@@ -12,7 +12,7 @@ import { ErrorWarning } from "./ErrorWarning";
12
12
  import { getErrorNotificationsManager } from "./errorWatcher";
13
13
  import { createMatchesPattern } from "../IndexedLogs/bufferSearchFindMatcher";
14
14
  import { cacheLimited } from "socket-function/src/caching";
15
- import { managementPageURL } from "../../managementPages";
15
+ import { managementPageURL, showingManagementURL } from "../../managementPages";
16
16
  import { searchTextURL, readProductionLogsURL } from "../IndexedLogs/LogViewerParams";
17
17
  import { startTimeParam, endTimeParam } from "../TimeRangeSelector";
18
18
  import { timeInHour } from "socket-function/src/misc";
@@ -56,6 +56,7 @@ export class LogDatumRenderer extends qreact.Component<{
56
56
  let logViewerValues: URLOverride[] | undefined;
57
57
  {
58
58
  logViewerValues = [
59
+ showingManagementURL.getOverride(true),
59
60
  managementPageURL.getOverride("LogViewer3"),
60
61
  readProductionLogsURL.getOverride(isPublic()),
61
62
  startTimeParam.getOverride(datum.time - timeInHour),
@@ -147,7 +148,7 @@ export class LogDatumRenderer extends qreact.Component<{
147
148
  e.stopPropagation();
148
149
  }
149
150
  Querysub.onCommitFinished(async () => {
150
- await this.manager.updateTimeout(timedOutMatches[0].id, Infinity);
151
+ await this.manager.updateTimeout(timedOutMatches[0].id, Number.MAX_SAFE_INTEGER);
151
152
  });
152
153
  }}
153
154
  >
@@ -294,7 +295,7 @@ export class ErrorNotificationPage extends qreact.Component {
294
295
  if (pattern) {
295
296
  this.state.newNotABugPattern = pattern;
296
297
  Querysub.onCommitFinished(async () => {
297
- await this.manager.addSuppression(pattern, Infinity);
298
+ await this.manager.addSuppression(pattern, Number.MAX_SAFE_INTEGER);
298
299
  Querysub.commit(() => {
299
300
  this.state.newNotABugPattern = "";
300
301
  });
@@ -370,7 +371,7 @@ class SuppressionItem extends qreact.Component<{
370
371
  }
371
372
 
372
373
  let timeoutText: preact.ComponentChild;
373
- if (suppression.timeout === Infinity) {
374
+ if (suppression.timeout >= Number.MAX_SAFE_INTEGER) {
374
375
  timeoutText = "Never expires";
375
376
  } else if (suppression.timeout > Date.now()) {
376
377
  timeoutText = <span>Expires <b>{formatTime(suppression.timeout - Date.now())}</b></span>;
@@ -382,6 +383,7 @@ class SuppressionItem extends qreact.Component<{
382
383
  <div className={css.hbox(12)}>
383
384
  <ATag
384
385
  values={[
386
+ showingManagementURL.getOverride(true),
385
387
  managementPageURL.getOverride("LogViewer3"),
386
388
  searchTextURL.getOverride(suppression.pattern),
387
389
  readProductionLogsURL.getOverride(true),
@@ -404,7 +406,7 @@ class SuppressionItem extends qreact.Component<{
404
406
  hue={120}
405
407
  onClick={() => {
406
408
  Querysub.onCommitFinished(async () => {
407
- await this.manager.updateTimeout(suppression.id, Infinity);
409
+ await this.manager.updateTimeout(suppression.id, Number.MAX_SAFE_INTEGER);
408
410
  });
409
411
  }}
410
412
  >