querysub 0.311.0 → 0.313.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/.cursorrules +1 -1
- package/costsBenefits.txt +4 -1
- package/package.json +3 -2
- package/spec.txt +23 -18
- package/src/-0-hooks/hooks.ts +1 -1
- package/src/-a-archives/archives.ts +16 -3
- package/src/-a-archives/archivesBackBlaze.ts +51 -3
- package/src/-a-archives/archivesLimitedCache.ts +175 -0
- package/src/-a-archives/archivesPrivateFileSystem.ts +299 -0
- package/src/-a-auth/certs.ts +58 -31
- package/src/-b-authorities/cdnAuthority.ts +2 -2
- package/src/-b-authorities/dnsAuthority.ts +3 -2
- package/src/-c-identity/IdentityController.ts +9 -2
- package/src/-d-trust/NetworkTrust2.ts +38 -31
- package/src/-e-certs/EdgeCertController.ts +3 -4
- package/src/-e-certs/certAuthority.ts +1 -2
- package/src/-f-node-discovery/NodeDiscovery.ts +20 -13
- package/src/-g-core-values/NodeCapabilities.ts +6 -1
- package/src/0-path-value-core/NodePathAuthorities.ts +1 -1
- package/src/0-path-value-core/PathValueCommitter.ts +3 -3
- package/src/0-path-value-core/PathValueController.ts +3 -3
- package/src/0-path-value-core/archiveLocks/ArchiveLocks2.ts +15 -37
- package/src/0-path-value-core/pathValueCore.ts +4 -3
- package/src/3-path-functions/PathFunctionRunner.ts +2 -2
- package/src/4-dom/qreact.tsx +4 -3
- package/src/4-querysub/Querysub.ts +2 -2
- package/src/4-querysub/QuerysubController.ts +2 -2
- package/src/5-diagnostics/GenericFormat.tsx +1 -0
- package/src/5-diagnostics/Table.tsx +3 -0
- package/src/5-diagnostics/diskValueAudit.ts +2 -1
- package/src/5-diagnostics/nodeMetadata.ts +0 -1
- package/src/deployManager/components/MachineDetailPage.tsx +9 -1
- package/src/deployManager/components/ServiceDetailPage.tsx +10 -1
- package/src/diagnostics/NodeViewer.tsx +3 -4
- package/src/diagnostics/logs/FastArchiveAppendable.ts +748 -0
- package/src/diagnostics/logs/FastArchiveController.ts +524 -0
- package/src/diagnostics/logs/FastArchiveViewer.tsx +863 -0
- package/src/diagnostics/logs/LogViewer2.tsx +349 -0
- package/src/diagnostics/logs/TimeRangeSelector.tsx +94 -0
- package/src/diagnostics/logs/diskLogger.ts +135 -305
- package/src/diagnostics/logs/diskShimConsoleLogs.ts +6 -29
- package/src/diagnostics/logs/errorNotifications/ErrorNotificationController.ts +577 -0
- package/src/diagnostics/logs/errorNotifications/ErrorSuppressionUI.tsx +225 -0
- package/src/diagnostics/logs/errorNotifications/ErrorWarning.tsx +207 -0
- package/src/diagnostics/logs/importLogsEntry.ts +38 -0
- package/src/diagnostics/logs/injectFileLocationToConsole.ts +7 -17
- package/src/diagnostics/logs/lifeCycleAnalysis/lifeCycles.tsx +0 -0
- package/src/diagnostics/logs/lifeCycleAnalysis/spec.md +151 -0
- package/src/diagnostics/managementPages.tsx +7 -16
- package/src/diagnostics/misc-pages/ComponentSyncStats.tsx +0 -1
- package/src/diagnostics/periodic.ts +5 -0
- package/src/diagnostics/watchdog.ts +2 -2
- package/src/functional/SocketChannel.ts +67 -0
- package/src/library-components/Input.tsx +1 -1
- package/src/library-components/InputLabel.tsx +5 -2
- package/src/misc.ts +111 -0
- package/src/src.d.ts +34 -1
- package/src/user-implementation/userData.ts +4 -3
- package/test.ts +13 -0
- package/testEntry2.ts +29 -0
- package/src/diagnostics/errorLogs/ErrorLogController.ts +0 -535
- package/src/diagnostics/errorLogs/ErrorLogCore.ts +0 -274
- package/src/diagnostics/errorLogs/LogClassifiers.tsx +0 -308
- package/src/diagnostics/errorLogs/LogFilterUI.tsx +0 -84
- package/src/diagnostics/errorLogs/LogNotify.tsx +0 -101
- package/src/diagnostics/errorLogs/LogTimeSelector.tsx +0 -723
- package/src/diagnostics/errorLogs/LogViewer.tsx +0 -757
- package/src/diagnostics/errorLogs/logFiltering.tsx +0 -149
- package/src/diagnostics/logs/DiskLoggerPage.tsx +0 -613
|
@@ -35,7 +35,6 @@ import { LoggingClient } from "../0-path-value-core/LoggingClient";
|
|
|
35
35
|
import * as prediction from "./querysubPrediction";
|
|
36
36
|
import { getCallResultPath } from "./querysubPrediction";
|
|
37
37
|
import { nodePathAuthority, pathValueAuthority2 } from "../0-path-value-core/NodePathAuthorities";
|
|
38
|
-
import { diskLog } from "../diagnostics/logs/diskLogger";
|
|
39
38
|
import { assertIsManagementUser } from "../diagnostics/managementPages";
|
|
40
39
|
import { getBrowserUrlNode } from "../-f-node-discovery/NodeDiscovery";
|
|
41
40
|
setFlag(require, "preact", "allowclient", true);
|
|
@@ -44,6 +43,7 @@ import yargs from "yargs";
|
|
|
44
43
|
import { mergeFilterables, parseFilterable, serializeFilterable } from "../misc/filterable";
|
|
45
44
|
import { isManagementUser, onAllPredictionsFinished } from "../-0-hooks/hooks";
|
|
46
45
|
import { getDomain, isBootstrapOnly, isLocal } from "../config";
|
|
46
|
+
import { logDisk } from "../diagnostics/logs/diskLogger";
|
|
47
47
|
|
|
48
48
|
let yargObj = isNodeTrue() && yargs(process.argv)
|
|
49
49
|
.option("fncfilter", { type: "string", default: "", desc: `Sets the filterable state for function calls, causing them to target specific FunctionRunners. If no FunctionRunner matches, all functions will fail to run. For example: "devtestserver" will match a FunctionRunner that uses the "devtestserver" filter. Merges with the existing filterable state if a client sets it explicitly.` })
|
|
@@ -452,7 +452,7 @@ export class QuerysubControllerBase {
|
|
|
452
452
|
// make the UI look cleaner (instead of showing stale values, it shows nothing)?
|
|
453
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
|
+
logDisk("log", "Disallowing PathValue watches due to disallowed permissions", { count: newPathsNotAllowed.length, callerId });
|
|
456
456
|
|
|
457
457
|
ignoreErrors(pathValueSerializer.serialize(undefinedValues, { compress: Querysub.COMPRESS_NETWORK }).then(buffers =>
|
|
458
458
|
PathValueController.nodes[callerId].forwardWrites(
|
|
@@ -168,6 +168,7 @@ export function formatValue(value: unknown, formatter: JSXFormatter = "guess", c
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
export function toSpaceCase(text: string) {
|
|
171
|
+
if (text.startsWith("_")) return text;
|
|
171
172
|
return text
|
|
172
173
|
// "camelCase" => "camel Case"
|
|
173
174
|
// "URL" => "URL"
|
|
@@ -33,6 +33,8 @@ export class Table<RowT extends RowType> extends qreact.Component<TableType<RowT
|
|
|
33
33
|
lineLimit?: number;
|
|
34
34
|
characterLimit?: number;
|
|
35
35
|
dark?: boolean;
|
|
36
|
+
|
|
37
|
+
getRowAttributes?: (row: RowT, index: number) => preact.JSX.HTMLAttributes<HTMLTableRowElement>;
|
|
36
38
|
}> {
|
|
37
39
|
state = {
|
|
38
40
|
limit: this.props.initialLimit || 100,
|
|
@@ -67,6 +69,7 @@ export class Table<RowT extends RowType> extends qreact.Component<TableType<RowT
|
|
|
67
69
|
// be able to above our siblings, which breaks palettes).
|
|
68
70
|
+ css.relative
|
|
69
71
|
}
|
|
72
|
+
{...this.props.getRowAttributes?.(row, index)}
|
|
70
73
|
>
|
|
71
74
|
<td class={css.center}>{index + 1}</td>
|
|
72
75
|
{Object.entries(columns).filter(x => x[1] !== null).map(([columnName, column]) => {
|
|
@@ -11,6 +11,7 @@ import { isDevDebugbreak } from "../config";
|
|
|
11
11
|
import { DebugLog, auditLog, getLogHistoryEquals } from "../0-path-value-core/auditLogs";
|
|
12
12
|
import { getOwnNodeId } from "../-f-node-discovery/NodeDiscovery";
|
|
13
13
|
import { sort } from "socket-function/src/misc";
|
|
14
|
+
import { logDisk } from "../diagnostics/logs/diskLogger";
|
|
14
15
|
|
|
15
16
|
const AUDIT_INTERVAL = ARCHIVE_FLUSH_LIMIT;
|
|
16
17
|
const AUDIT_THRESHOLD = ARCHIVE_FLUSH_LIMIT;
|
|
@@ -187,7 +188,7 @@ async function checkAuthority(authority: AuthorityPath, threshold: number) {
|
|
|
187
188
|
console.error(`Value mismatch between disk and memory for ${formatNumber(changedValues.size)} values. Ex: ${firstValue.path}`);
|
|
188
189
|
}
|
|
189
190
|
if (removedValues.size > 0) {
|
|
190
|
-
|
|
191
|
+
logDisk("log", green(`Removing ${formatNumber(removedValues.size)} paths from memory which have been GCed on the disk.`));
|
|
191
192
|
}
|
|
192
193
|
if (changedValues.size > 0 || removedValues.size > 0) {
|
|
193
194
|
let allValues = new Set([...changedValues, ...removedValues]);
|
|
@@ -10,7 +10,6 @@ import { sort, throttleFunction, timeInMinute } from "socket-function/src/misc";
|
|
|
10
10
|
import { formatNumber, formatPercent, formatTime } from "socket-function/src/formatting/format";
|
|
11
11
|
import os from "os";
|
|
12
12
|
import { isNode } from "typesafecss";
|
|
13
|
-
import { diskLog } from "../diagnostics/logs/diskLogger";
|
|
14
13
|
import { devDebugbreak } from "../config";
|
|
15
14
|
import { addStatPeriodic, addStatSumPeriodic, addTimeProfileDistribution, onTimeProfile, logNodeStats, logNodeStateStats, registerNodeMetadata } from "../-0-hooks/hooks";
|
|
16
15
|
import { magenta } from "socket-function/src/formatting/logColors";
|
|
@@ -5,8 +5,10 @@ import { css } from "typesafecss";
|
|
|
5
5
|
import { currentViewParam, selectedMachineIdParam, selectedServiceIdParam } from "../urlParams";
|
|
6
6
|
import { formatNumber, formatVeryNiceDateTime } from "socket-function/src/formatting/format";
|
|
7
7
|
import { sort } from "socket-function/src/misc";
|
|
8
|
-
import { Anchor } from "../../library-components/ATag";
|
|
8
|
+
import { ATag, Anchor } from "../../library-components/ATag";
|
|
9
9
|
import { ShowMore } from "../../library-components/ShowMore";
|
|
10
|
+
import { filterParam } from "../../diagnostics/logs/FastArchiveViewer";
|
|
11
|
+
import { managementPageURL } from "../../diagnostics/managementPages";
|
|
10
12
|
|
|
11
13
|
export class MachineDetailPage extends qreact.Component {
|
|
12
14
|
render() {
|
|
@@ -62,6 +64,12 @@ export class MachineDetailPage extends qreact.Component {
|
|
|
62
64
|
<div>
|
|
63
65
|
Apply Node ID: {machine.applyNodeId}
|
|
64
66
|
</div>
|
|
67
|
+
<ATag values={[
|
|
68
|
+
managementPageURL.getOverride("LogViewer2"),
|
|
69
|
+
filterParam.getOverride(`__machineId = ${machineInfo.machineId}`),
|
|
70
|
+
]}>
|
|
71
|
+
Machine Logs
|
|
72
|
+
</ATag>
|
|
65
73
|
</div>
|
|
66
74
|
|
|
67
75
|
<div>
|
|
@@ -13,13 +13,15 @@ import { Button } from "../../library-components/Button";
|
|
|
13
13
|
import { isDefined } from "../../misc";
|
|
14
14
|
import { watchScreenOutput, stopWatchingScreenOutput } from "../machineController";
|
|
15
15
|
import { getPathStr2 } from "../../path";
|
|
16
|
-
import { Anchor } from "../../library-components/ATag";
|
|
16
|
+
import { ATag, Anchor } from "../../library-components/ATag";
|
|
17
17
|
import { ScrollOnMount } from "../../library-components/ScrollOnMount";
|
|
18
18
|
import { StickyBottomScroll } from "../../library-components/StickyBottomScroll";
|
|
19
19
|
import { PrimitiveDisplay } from "../../diagnostics/logs/ObjectDisplay";
|
|
20
20
|
import { parseAnsiColors, rgbToHsl } from "../../diagnostics/logs/ansiFormat";
|
|
21
21
|
import { RenderGitRefInfo, UpdateServiceButtons, bigEmoji, buttonStyle } from "./deployButtons";
|
|
22
22
|
import { TypedConfigEditor } from "../../library-components/TypedConfigEditor";
|
|
23
|
+
import { filterParam } from "../../diagnostics/logs/FastArchiveViewer";
|
|
24
|
+
import { managementPageURL } from "../../diagnostics/managementPages";
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
|
|
@@ -333,6 +335,13 @@ export class ServiceDetailPage extends qreact.Component {
|
|
|
333
335
|
>
|
|
334
336
|
{isWatching ? "Stop Watching Output" : "Watch Screen Output"}
|
|
335
337
|
</div>
|
|
338
|
+
|
|
339
|
+
<ATag values={[
|
|
340
|
+
managementPageURL.getOverride("LogViewer2"),
|
|
341
|
+
filterParam.getOverride(`__nodeId = ${machineId}`),
|
|
342
|
+
]}>
|
|
343
|
+
Machine Logs
|
|
344
|
+
</ATag>
|
|
336
345
|
</div>
|
|
337
346
|
{hasError && (
|
|
338
347
|
<div
|
|
@@ -35,9 +35,9 @@ import { ButtonSelector } from "../library-components/ButtonSelector";
|
|
|
35
35
|
import { assertIsManagementUser, managementPageURL } from "./managementPages";
|
|
36
36
|
import { SocketRegistered } from "socket-function/SocketFunctionTypes";
|
|
37
37
|
import { ATag } from "../library-components/ATag";
|
|
38
|
-
import { filterURL, selectedNodeId } from "./logs/DiskLoggerPage";
|
|
39
38
|
import { getSyncedController } from "../library-components/SyncedController";
|
|
40
39
|
import child_process from "child_process";
|
|
40
|
+
import { filterParam } from "./logs/FastArchiveViewer";
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
type NodeData = {
|
|
@@ -296,9 +296,8 @@ export class NodeViewer extends qreact.Component {
|
|
|
296
296
|
|
|
297
297
|
return (
|
|
298
298
|
<ATag values={[
|
|
299
|
-
managementPageURL.getOverride("
|
|
300
|
-
|
|
301
|
-
filterURL.getOverride(`"__nodeId":"${str}"`),
|
|
299
|
+
managementPageURL.getOverride("LogViewer2"),
|
|
300
|
+
filterParam.getOverride(`__nodeId = ${str}`),
|
|
302
301
|
]}>
|
|
303
302
|
Logs
|
|
304
303
|
</ATag>
|