querysub 0.373.0 → 0.375.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 (47) hide show
  1. package/package.json +2 -4
  2. package/src/-f-node-discovery/NodeDiscovery.ts +2 -2
  3. package/src/0-path-value-core/PathValueCommitter.ts +1 -1
  4. package/src/0-path-value-core/PathValueController.ts +2 -2
  5. package/src/0-path-value-core/archiveLocks/ArchiveLocks2.ts +12 -12
  6. package/src/0-path-value-core/auditLogs.ts +1 -1
  7. package/src/0-path-value-core/pathValueCore.ts +2 -2
  8. package/src/3-path-functions/PathFunctionRunner.ts +1 -1
  9. package/src/3-path-functions/PathFunctionRunnerMain.ts +1 -1
  10. package/src/4-dom/qreact.tsx +2 -2
  11. package/src/4-querysub/QuerysubController.ts +1 -1
  12. package/src/5-diagnostics/diskValueAudit.ts +1 -1
  13. package/src/deployManager/components/MachineDetailPage.tsx +2 -5
  14. package/src/deployManager/components/ServiceDetailPage.tsx +2 -5
  15. package/src/deployManager/machineApplyMainCode.ts +7 -0
  16. package/src/diagnostics/NodeViewer.tsx +4 -5
  17. package/src/diagnostics/logs/IndexedLogs/BufferIndexHelpers.ts +1 -1
  18. package/src/diagnostics/logs/IndexedLogs/IndexedLogs.ts +7 -7
  19. package/src/diagnostics/logs/IndexedLogs/LogViewer3.tsx +221 -220
  20. package/src/diagnostics/logs/IndexedLogs/LogViewerParams.ts +21 -0
  21. package/src/diagnostics/logs/IndexedLogs/bufferMatcher.ts +3 -3
  22. package/src/diagnostics/logs/diskLogger.ts +1 -39
  23. package/src/diagnostics/logs/diskShimConsoleLogs.ts +2 -0
  24. package/src/diagnostics/logs/errorNotifications2/errorNotifications2.ts +3 -0
  25. package/src/diagnostics/logs/injectFileLocationToConsole.ts +3 -0
  26. package/src/diagnostics/logs/lifeCycleAnalysis/lifeCycles.tsx +32 -22
  27. package/src/diagnostics/managementPages.tsx +0 -18
  28. package/src/diagnostics/watchdog.ts +1 -1
  29. package/src/user-implementation/userData.ts +3 -3
  30. package/test.ts +0 -5
  31. package/bin/error-email.js +0 -8
  32. package/bin/error-im.js +0 -8
  33. package/src/diagnostics/logs/FastArchiveAppendable.ts +0 -843
  34. package/src/diagnostics/logs/FastArchiveController.ts +0 -573
  35. package/src/diagnostics/logs/FastArchiveViewer.tsx +0 -1090
  36. package/src/diagnostics/logs/LogViewer2.tsx +0 -552
  37. package/src/diagnostics/logs/errorNotifications/ErrorDigestPage.tsx +0 -409
  38. package/src/diagnostics/logs/errorNotifications/ErrorNotificationController.ts +0 -756
  39. package/src/diagnostics/logs/errorNotifications/ErrorSuppressionUI.tsx +0 -280
  40. package/src/diagnostics/logs/errorNotifications/ErrorWarning.tsx +0 -254
  41. package/src/diagnostics/logs/errorNotifications/errorDigestEmail.tsx +0 -233
  42. package/src/diagnostics/logs/errorNotifications/errorDigestEntry.tsx +0 -14
  43. package/src/diagnostics/logs/errorNotifications/errorDigests.tsx +0 -292
  44. package/src/diagnostics/logs/errorNotifications/errorWatchEntry.tsx +0 -209
  45. package/src/diagnostics/logs/importLogsEntry.ts +0 -38
  46. package/src/diagnostics/logs/lifeCycleAnalysis/LifeCyclePages.tsx +0 -150
  47. package/src/diagnostics/logs/logViewerExtractField.ts +0 -36
@@ -20,16 +20,11 @@ IMPORTANT! Now I am properly calling shutdown, so none of the streamed logs shou
20
20
 
21
21
 
22
22
 
23
- 3) Ensure our moveloops are working correctly, on both dev and public
24
-
25
-
26
- 1) Fix missing __NAME__
27
- "Received PathValue for path" misses name?
28
- - Maybe the missing name only happens when we rate limit?
29
23
 
30
24
  2) Create lot of remote server logs
31
25
  - Via our refresh loop
32
26
 
27
+
33
28
  3) Verify search is still fast, and works correctly!
34
29
  - Try to get a rare value in that is in the logs, but is hard to find
35
30
  Good rare search. Checks for sending emails, which we do very rarely. If we pack in 10GB of logs after this, it will really stress our indexing system.
@@ -37,25 +32,27 @@ IMPORTANT! Now I am properly calling shutdown, so none of the streamed logs shou
37
32
  https://127-0-0-1.querysubtest.com:7007/?hot&readPublicLogs&showingmanagement&machineview=services&managementpage=LogViewer3&searchText=Sending%20email&selectedFields=%7B%22path%22%3Atrue%7D
38
33
 
39
34
 
35
+
36
+ Remove old error digest/notification code
37
+ - We don't need email digests anymore. I think discord messaging is enough
38
+ Remove all old LogViewer/FastArchiveAppendable code
39
+ - Make sure to find all links and update them as well
40
40
 
41
- Rewrite error notification code
42
- THINK about how to do a somewhat generic logs => derived thing, as... we will need the exact same thing for life cycles!
43
- - Maybe make it generic immediately? Having it abstracted it kind of nice for development anyways...
44
- - New service that manages it, instead of doing it on demand
45
- - It asks everyone to send it error logs
46
- - Stores cached error logs => { unsuppressed logs, suppressionSummary }
47
- - Unsuppressed logs only for suppression which is old enough.
48
- - Only when logs are old enough.
49
- - Stores in memory with all suppressionSummaries
50
- AND, the only watcher will be the watcher service. You can't get recent errors, or any errors, without going through one of those
51
- NO dev errors. They are usually red-herrings anyways... and we should just be using public servers for regular usage
52
- - And we still have dev logs we can check if to see if an error happened locally
53
- ALSO owns the discord messaging code
54
41
 
55
42
 
43
+ Rewrite error notification code
44
+ - Single service, which talks to all machines
45
+ - We'll have a dev mode, mostly for testing, although we won't usually run it.
46
+ - BROADCASTS messages to all http servers so they show them
47
+ - Broadcast messages only has one type now "error notification", but add TODO for more types, which may display in different ways (via toast, etc)
48
+ - Maybe only streaming? We'll miss some, but... not that much...
49
+ - ALSO owns the discord messaging code
50
+ - Suppression... will work in the service itself. Because there shouldn't be THAT many errors happening!
51
+ - Suppression will use AI to group?
52
+ - BUT, we will still have page that shows suppression list, with counts and times
53
+ - Page links to search, which tries to find those errors (we should use the same format for suppression as search, so it should be fairly easy to do that)
54
+
56
55
 
57
- Remove all old LogViewer/FastArchiveAppendable code
58
- - Make sure to find all links and update them as well
59
56
 
60
57
 
61
58
  0) Add LZ4 compression to socket-function by default
@@ -63,12 +60,25 @@ Remove all old LogViewer/FastArchiveAppendable code
63
60
  - default is "lz4"
64
61
  - REQUIRES feature checking the remote, to make sure it is new enough to accept this.
65
62
  - A generic thing which gets the version is probably fine.
63
+ - When decoding, I think we should just check the first byte. It should be a magic number which tells us which compression it's using.
66
64
  - LZ4 compression is fast enough that this should cause basically no overhead, and in many cases greatly reduce the bandwidth (which will increase the speed).
67
65
  - We're gonna have to investigate how we're sending buffers anyway. I think this should be easy, but we
68
- 0.1) Verify the size distance with some local testing
66
+ 0.1) Verify the size difference with some local testing
69
67
  - ALSO, verify the processing overhead is acceptable.
70
68
  1) Deploy, which SHOULD be backwards compatible with everything?
71
69
 
70
+
71
+ -1) Change PathValueSerialize to use LZ4
72
+ - I think we already have a compression flag here, so it should be easy enough to just support it to change it to support LZ4.
73
+ - I think we want to disable the server, and then when we launch the server locally, it should have to read from disk.
74
+ -2) It would probably be valuable to test the synchronization speed between two different servers. It seems like when the remote is running and we start a local server, it really takes a long time for it to get ready. As in minutes.
75
+ - This might have already been fixed by us improving the compression speed to not use gzip, maybe, but we should test it again, and if not, we should see what's slow
76
+ - We might need to jump into the server and look at its profiles there by forcing them to omit, which isn't too hard, but it is kind of annoying.
77
+
78
+ -3) During server startup (when there is a remote server), we spend a lot of time in identityHook.
79
+ - BUT... Our check to see if the async call that we're doing underneath is taking more than 200 milliseconds, is never firing. Even though apparently plenty of calls are taking over a second in total, so what why is it slow? Are some of the synchronous functions we're calling slow?
80
+ - Basically, there's nowhere that could be slow, and we're timing it, and it times as being fast. However, in the profiles, it shows up as being slow.
81
+ - It could also be an asynchronous issue, so some other timing is getting alias to it. That is feasible...
72
82
  */
73
83
 
74
84
 
@@ -28,8 +28,6 @@ import { addComponentButton } from "../5-diagnostics/qreactDebug";
28
28
  import { closeAllModals } from "../5-diagnostics/Modal";
29
29
  import { delay } from "socket-function/src/batching";
30
30
 
31
- const ErrorWarning = createLazyComponent(() => import("./logs/errorNotifications/ErrorWarning"))("ErrorWarning");
32
-
33
31
  export const managementPageURL = new URLParam("managementpage", "");
34
32
  export const showingManagementURL = new URLParam("showingmanagement", false);
35
33
 
@@ -86,26 +84,11 @@ export async function registerManagementPages2(config: {
86
84
  controllerName: "NodeViewerController",
87
85
  getModule: () => import("./NodeViewer"),
88
86
  });
89
- inputPages.push({
90
- title: "Logs",
91
- componentName: "LogViewer2",
92
- getModule: () => import("./logs/LogViewer2"),
93
- });
94
87
  inputPages.push({
95
88
  title: "Logs3",
96
89
  componentName: "LogViewer3",
97
90
  getModule: () => import("./logs/IndexedLogs/LogViewer3"),
98
91
  });
99
- inputPages.push({
100
- title: "Life Cycles",
101
- componentName: "LifeCyclePages",
102
- getModule: () => import("./logs/lifeCycleAnalysis/LifeCyclePages"),
103
- });
104
- inputPages.push({
105
- title: "Error Digests",
106
- componentName: "ErrorDigestPage",
107
- getModule: () => import("./logs/errorNotifications/ErrorDigestPage"),
108
- });
109
92
  inputPages.push({
110
93
  title: "Security",
111
94
  componentName: "SecurityPage",
@@ -339,7 +322,6 @@ class ManagementRoot extends qreact.Component {
339
322
  `}
340
323
  </style>
341
324
  <div class={css.fillWidth.hbox(30, 10).wrap.hsl(245, 25, 60).pad2(10).pointerEvents("all")}>
342
- <ErrorWarning />
343
325
  {pages.map(page =>
344
326
  <ATag values={[{ param: managementPageURL, value: page.componentName }]}>{page.title}</ATag>
345
327
  )}
@@ -72,7 +72,7 @@ function logProfileMeasuresTimingsNow() {
72
72
  measureObj = startMeasure();
73
73
  function diskLogMeasureObj(table: FormattedMeasureTable | undefined) {
74
74
  if (!table) return;
75
- logDisk("log", table.title, { entries: table.entries });
75
+ console.info(table.title, { entries: table.entries });
76
76
  }
77
77
  diskLogMeasureObj(logMeasureTable(profile, {
78
78
  name: `watchdog at ${new Date().toLocaleString()}`,
@@ -626,7 +626,7 @@ function sendLoginEmail(config: {
626
626
  );
627
627
  if (alreadyAllowed) {
628
628
  data().machineSecure[machineId].userId = userId;
629
- logDisk("log", `User ${userId} already allowed for current ip and machine id, no need to send email.`);
629
+ console.info(`User ${userId} already allowed for current ip and machine id, no need to send email.`);
630
630
  return;
631
631
  }
632
632
  }
@@ -818,14 +818,14 @@ function inviteUser(config: { email: string }) {
818
818
  Querysub.ignorePermissionsChecks(() => {
819
819
  let curUserObj = getUserObjAssert();
820
820
  if (config.email in curUserObj.invitedUsers2) {
821
- logDisk("log", `User ${config.email} already invited`);
821
+ console.info(`User ${config.email} already invited`);
822
822
  return;
823
823
  }
824
824
  // If the user already exists, don't invite
825
825
  const { email } = config;
826
826
  let userId = atomic(data().secure.emailToUserId[email]) || createNewUserId();
827
827
  if (userId in data().users) {
828
- logDisk("log", `User ${userId} already exists, no need to invite`);
828
+ console.info(`User ${userId} already exists, no need to invite`);
829
829
  return;
830
830
  }
831
831
 
package/test.ts CHANGED
@@ -1,11 +1,6 @@
1
1
  import { Querysub } from "./src/4-querysub/QuerysubController";
2
2
  // Import querysub, so inject is run
3
3
  Querysub;
4
- import { formatTime } from "socket-function/src/formatting/format";
5
- import { getMachineId, getOwnMachineId } from "./src/-a-auth/certs";
6
- import { testLogs } from "./src/diagnostics/logs/LogViewer2";
7
- import { shutdown } from "./src/diagnostics/periodic";
8
- import crypto from "crypto";
9
4
  import { testMain } from "./testEntry2";
10
5
 
11
6
  testMain().catch(console.error).finally(() => {
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // public, so we can connect to it from any node (for diagnostics, etc)
4
- process.argv.push("--public");
5
- process.argv.push("--nobreak");
6
-
7
- require("typenode");
8
- require("../src/diagnostics/logs/errorNotifications/errorDigestEntry.tsx");
package/bin/error-im.js DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // public, so we can connect to it from any node (for diagnostics, etc)
4
- process.argv.push("--public");
5
- process.argv.push("--nobreak");
6
-
7
- require("typenode");
8
- require("../src/diagnostics/logs/errorNotifications/errorWatchEntry.tsx");