querysub 0.413.0 → 0.415.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.413.0",
3
+ "version": "0.415.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",
@@ -19,6 +19,10 @@ import { waitForFirstTimeSync } from "socket-function/time/trueTimeShim";
19
19
  import { red } from "socket-function/src/formatting/logColors";
20
20
  import { isNode } from "typesafecss";
21
21
  import { areNodeIdsEqual, getOwnNodeId, getOwnThreadId } from "../-f-node-discovery/NodeDiscovery";
22
+ import { timeInMinute } from "socket-function/src/misc";
23
+
24
+ // NOTE: This used to be small, but we cache this, so it would mean a node on startup would time out, and then we would refuse to talk to it ever again. So... this can't be small
25
+ const MAX_CHANGE_IDENTITY_TIMEOUT = timeInMinute * 5;
22
26
 
23
27
  let callerInfo = new Map<CallerContext, {
24
28
  reconnectNodeId: string | undefined;
@@ -130,7 +134,7 @@ class IdentityControllerBase {
130
134
  let time = Date.now();
131
135
  const caller = SocketFunction.getCaller();
132
136
  // Verify it wasn't signed too long ago (to make signature stealing WAY more difficult).
133
- const signedThreshold = Date.now() - 1000 * 30;
137
+ const signedThreshold = Date.now() - MAX_CHANGE_IDENTITY_TIMEOUT;
134
138
  if (payload.time < signedThreshold) {
135
139
  throw new Error(`Signed payload too old, ${payload.time} < ${signedThreshold} from ${caller.localNodeId} (${caller.nodeId})`);
136
140
  }
@@ -235,8 +239,7 @@ const changeIdentityOnce = cacheWeak(async function changeIdentityOnce(connectio
235
239
  };
236
240
  let signature = sign(threadKeyCert, payload);
237
241
  await timeoutToError(
238
- // NOTE: This timeout has to be small as if we try to connect to a node to send it something time sensitive such as a PathValue and it takes too long it might result in us having a PathValue which is expired. The threshold is around 60 seconds and so we want to build a timeout calling a few different nodes before the PathValue expires.
239
- 10 * 1000,
242
+ MAX_CHANGE_IDENTITY_TIMEOUT,
240
243
  IdentityController.nodes[nodeId].changeIdentity(signature, payload),
241
244
  () => new Error(`Timeout calling changeIdentity for ${nodeId}`)
242
245
  );
package/tempnotes.txt CHANGED
@@ -1,5 +1,37 @@
1
1
 
2
- Alright, well, looks like the writes aren't working. It's not sending it to the server at least. Or at least the server isn't receiving it.
2
+
3
+ Local CYOA + Local FunctionRunner works
4
+
5
+
6
+ Wait... Didn't we restart everything? Why does it seem like the function runner is still watching the same things?
7
+ "00020e3a3b543382.a794fbcf7b104c68.querysubtest.com:37381"
8
+
9
+
10
+
11
+ Hmm... we ask to watch it, but the watch doesn't show up on the other side? Fuck...
12
+
13
+ Hmm, it's still failing in the same way. The function runner just has, like, no watches. It tried to watch I assume the same thing as before. Nothing showed up on the other end.
14
+
15
+
16
+
17
+
18
+ So we have the remote watcher, so it looks like we were watching it, but we don't think it's synced, so we clearly didn't get a value back.
19
+
20
+ WATCHER FAILED TO SYNC findFunctionsToCall DID NOT RECEIVE PATH VALUES. This means PathValueServer is not responding to watches, either to specific paths, or for all paths [
21
+ '.,querysubtest._com.,',
22
+ '.,querysubtest._com.,PathFunctionRunner.,'
23
+ ] [ '.,querysubtest._com.,PathFunctionRunner.,' ] [Function: findFunctionsToCall]
24
+ Node list is missing nodes, resyncing node {
25
+ missingNodes: [ '716181d6570f7b55.a794fbcf7b104c68.querysubtest.com:34689' ],
26
+
27
+
28
+ UGH... poking fixed it. WHICH MEANS, we have to break it again, and get into the bad state again!
29
+ - Ugh...
30
+
31
+ -1) We got into a bad state where The query sub nodes weren't really listening or it's it th they had zombie watchers that hadn't finished synchronizing, but it wasn't complaining about being able to un to find any any paths. There were no unwatched paths
32
+ - It fixed when we poked them.
33
+
34
+ 0) If it fails after redeploying, disable the server and run everything locally again, as we made a lot of changes, and so it might not even work locally.
3
35
 
4
36
  -1) Get a test script that doesn't even use the function runner working.
5
37
 
@@ -12,6 +44,18 @@ Alright, well, looks like the writes aren't working. It's not sending it to the
12
44
  1.1) Verify by breaking into our local server that we are receiving values written on the remote server in the local server.
13
45
  - This is extremely important. Without this, we can't run a local server. There's all kinds of issues, but our socket function changes should make this so this just works.
14
46
 
47
+ 0) SHARD THE FUNCTION RUNNER!
48
+ - And secondary sharding for backup...
49
+ - First shard locally
50
+ - Test on our sync test page (Otherwise all the writes are going to go to the same function runner anyway, so it's not a good test.
51
+
52
+ -2) Errors are not being automatically grouped.
53
+ - We are getting notifications though, which is weird. The notifications are supposed to be automatically grouping it. We should probably look at its logs and see why.
54
+
55
+ 0) We just are constantly "Node list is missing nodes, resyncing node"
56
+ - We should check the logs. I'm assuming what happened is that at some point some server thought it was the wrong node ID and deleted it?
57
+ - It's generally the same ones, except new ones get added.
58
+
15
59
  I think even if we run into some occasional issues, we should just power through and try to fix them later. Because I'm sick of working on the framework...
16
60
 
17
61
  MONTHLY SUMMARY!