querysub 0.312.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.
Files changed (69) hide show
  1. package/.cursorrules +1 -1
  2. package/costsBenefits.txt +4 -1
  3. package/package.json +3 -2
  4. package/spec.txt +23 -18
  5. package/src/-0-hooks/hooks.ts +1 -1
  6. package/src/-a-archives/archives.ts +16 -3
  7. package/src/-a-archives/archivesBackBlaze.ts +51 -3
  8. package/src/-a-archives/archivesLimitedCache.ts +175 -0
  9. package/src/-a-archives/archivesPrivateFileSystem.ts +299 -0
  10. package/src/-a-auth/certs.ts +58 -31
  11. package/src/-b-authorities/cdnAuthority.ts +2 -2
  12. package/src/-b-authorities/dnsAuthority.ts +3 -2
  13. package/src/-c-identity/IdentityController.ts +3 -2
  14. package/src/-d-trust/NetworkTrust2.ts +17 -19
  15. package/src/-e-certs/EdgeCertController.ts +3 -4
  16. package/src/-e-certs/certAuthority.ts +1 -2
  17. package/src/-f-node-discovery/NodeDiscovery.ts +9 -7
  18. package/src/-g-core-values/NodeCapabilities.ts +6 -1
  19. package/src/0-path-value-core/NodePathAuthorities.ts +1 -1
  20. package/src/0-path-value-core/PathValueCommitter.ts +3 -3
  21. package/src/0-path-value-core/PathValueController.ts +3 -3
  22. package/src/0-path-value-core/archiveLocks/ArchiveLocks2.ts +15 -37
  23. package/src/0-path-value-core/pathValueCore.ts +4 -3
  24. package/src/3-path-functions/PathFunctionRunner.ts +2 -2
  25. package/src/4-dom/qreact.tsx +4 -3
  26. package/src/4-querysub/Querysub.ts +2 -2
  27. package/src/4-querysub/QuerysubController.ts +2 -2
  28. package/src/5-diagnostics/GenericFormat.tsx +1 -0
  29. package/src/5-diagnostics/Table.tsx +3 -0
  30. package/src/5-diagnostics/diskValueAudit.ts +2 -1
  31. package/src/5-diagnostics/nodeMetadata.ts +0 -1
  32. package/src/deployManager/components/MachineDetailPage.tsx +9 -1
  33. package/src/deployManager/components/ServiceDetailPage.tsx +10 -1
  34. package/src/diagnostics/NodeViewer.tsx +3 -4
  35. package/src/diagnostics/logs/FastArchiveAppendable.ts +748 -0
  36. package/src/diagnostics/logs/FastArchiveController.ts +524 -0
  37. package/src/diagnostics/logs/FastArchiveViewer.tsx +863 -0
  38. package/src/diagnostics/logs/LogViewer2.tsx +349 -0
  39. package/src/diagnostics/logs/TimeRangeSelector.tsx +94 -0
  40. package/src/diagnostics/logs/diskLogger.ts +135 -305
  41. package/src/diagnostics/logs/diskShimConsoleLogs.ts +6 -29
  42. package/src/diagnostics/logs/errorNotifications/ErrorNotificationController.ts +577 -0
  43. package/src/diagnostics/logs/errorNotifications/ErrorSuppressionUI.tsx +225 -0
  44. package/src/diagnostics/logs/errorNotifications/ErrorWarning.tsx +207 -0
  45. package/src/diagnostics/logs/importLogsEntry.ts +38 -0
  46. package/src/diagnostics/logs/injectFileLocationToConsole.ts +7 -17
  47. package/src/diagnostics/logs/lifeCycleAnalysis/lifeCycles.tsx +0 -0
  48. package/src/diagnostics/logs/lifeCycleAnalysis/spec.md +151 -0
  49. package/src/diagnostics/managementPages.tsx +7 -16
  50. package/src/diagnostics/misc-pages/ComponentSyncStats.tsx +0 -1
  51. package/src/diagnostics/periodic.ts +5 -0
  52. package/src/diagnostics/watchdog.ts +2 -2
  53. package/src/functional/SocketChannel.ts +67 -0
  54. package/src/library-components/Input.tsx +1 -1
  55. package/src/library-components/InputLabel.tsx +5 -2
  56. package/src/misc.ts +111 -0
  57. package/src/src.d.ts +34 -1
  58. package/src/user-implementation/userData.ts +4 -3
  59. package/test.ts +13 -0
  60. package/testEntry2.ts +29 -0
  61. package/src/diagnostics/errorLogs/ErrorLogController.ts +0 -535
  62. package/src/diagnostics/errorLogs/ErrorLogCore.ts +0 -274
  63. package/src/diagnostics/errorLogs/LogClassifiers.tsx +0 -308
  64. package/src/diagnostics/errorLogs/LogFilterUI.tsx +0 -84
  65. package/src/diagnostics/errorLogs/LogNotify.tsx +0 -101
  66. package/src/diagnostics/errorLogs/LogTimeSelector.tsx +0 -723
  67. package/src/diagnostics/errorLogs/LogViewer.tsx +0 -757
  68. package/src/diagnostics/errorLogs/logFiltering.tsx +0 -149
  69. package/src/diagnostics/logs/DiskLoggerPage.tsx +0 -613
@@ -1,101 +0,0 @@
1
- import { getBrowserUrlNode } from "../../../src/-f-node-discovery/NodeDiscovery";
2
- import { LogViewerController, LogViewerSynced, downloadLogsOnceURL } from "./LogViewer";
3
- import { ErrorLogControllerBase, LogIssueNotify, watchLogIssueNotify } from "../../../src/diagnostics/errorLogs/ErrorLogController";
4
- import { doAtomicWrites, atomic } from "../../../src/2-proxy/PathValueProxyWatcher";
5
- import { ExternalRenderClass, qreact } from "../../../src/4-dom/qreact";
6
- import { Querysub } from "../../../src/4-querysub/Querysub";
7
- import { isClient } from "../../../src/config2";
8
- import { logErrors } from "../../../src/errors";
9
- import { lazy } from "socket-function/src/caching";
10
- import { SocketFunction } from "socket-function/SocketFunction";
11
- import { css } from "typesafecss";
12
- import { formatDate, formatTime } from "socket-function/src/formatting/format";
13
- import { errorMessage, warnMessage } from "../../../src/5-diagnostics/GenericFormat";
14
- import { Anchor } from "../../../src/library-components/ATag";
15
- import { renderIsManagementUser, showingManagementURL, managementPageURL, assertIsManagementUser } from "../managementPages";
16
-
17
- export class LogNotify extends qreact.Component<{
18
- class?: string;
19
- }> {
20
- public render() {
21
- if (!renderIsManagementUser()) return undefined;
22
- let issues = getLogIssues();
23
- let top = issues?.oldestUnsuppressed || issues?.oldestUngrouped;
24
- if (!top) return undefined;
25
-
26
- return <Anchor
27
- title={`At ${formatDate(top.time)}: ${top.message}`}
28
- target="_blank"
29
- class={
30
- css.ellipsis
31
- .overflowHidden
32
- + (issues?.oldestUngrouped ? errorMessage : warnMessage)
33
- + this.props.class
34
- }
35
- values={[
36
- { param: showingManagementURL, value: true },
37
- { param: managementPageURL, value: "LogViewer" },
38
- { param: downloadLogsOnceURL, value: true },
39
- ]}
40
- >
41
- {/* TODO: Detect a stack format, separate the message from the stack, and display them differently. */}
42
- ({formatTime(Date.now() - top.time)}) {stripANSI(top.message).replaceAll("\n", " \\n ")}
43
- </Anchor>;
44
- }
45
- }
46
- // `\x1b[38;2;${r};${g};${b}m${text}\x1b[0m` => text
47
- function stripANSI(text: string) {
48
- return text.replace(/\x1b\[[0-9;]*m/g, "");
49
- }
50
-
51
- let logIssueNotifyState = lazy(() => Querysub.createLocalSchema<{
52
- notify: LogIssueNotify | undefined;
53
- }>("logIssueNotify"));
54
- let watchers = new Set<ExternalRenderClass>();
55
- function onLogIssueNotify(notify: LogIssueNotify | undefined) {
56
- Querysub.commit(() => {
57
- doAtomicWrites(() => {
58
- logIssueNotifyState()().notify = notify;
59
- });
60
- });
61
- }
62
- setImmediate(() => {
63
- watchLogIssueNotify(onLogIssueNotify);
64
- });
65
-
66
- export function getLogIssues(): LogIssueNotify | undefined {
67
- if (!isClient()) throw new Error(`getLogIssues must be called clientside`);
68
- const currentComponent = qreact.getRenderingComponent();
69
- if (!currentComponent) throw new Error(`getLogIssues must be called from a component`);
70
-
71
- if (watchers.size === 0) {
72
- logErrors(ErrorLogControllerNotify.nodes[getBrowserUrlNode()].watchLogs(
73
- ErrorLogControllerNotify
74
- ));
75
- }
76
- if (!watchers.has(currentComponent)) {
77
- watchers.add(currentComponent);
78
- qreact.watchUnmount(currentComponent, () => {
79
- watchers.delete(currentComponent);
80
- if (watchers.size === 0) {
81
- logErrors(ErrorLogControllerNotify.nodes[getBrowserUrlNode()].unwatchLogs());
82
- }
83
- });
84
- }
85
-
86
- return atomic(logIssueNotifyState()().notify);
87
- }
88
-
89
-
90
- const ErrorLogControllerNotify = SocketFunction.register(
91
- "ErrorLogControllerNotify-9030f46d-e80d-462a-b78e-549143fe288a",
92
- new ErrorLogControllerBase(),
93
- () => ({
94
- watchLogs: {},
95
- unwatchLogs: {},
96
- logsIssueNotifyCallback: {},
97
- }),
98
- () => ({
99
- hooks: [assertIsManagementUser],
100
- }),
101
- );