querysub 0.267.0 → 0.269.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.267.0",
3
+ "version": "0.269.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",
@@ -247,11 +247,17 @@ async function edgeNodeFunction(config: {
247
247
  progressUI.setMessage("Finding available server...");
248
248
  let retryCount = 0;
249
249
  while (true) {
250
+ let cached = !!cachedConfig;
250
251
  try {
251
252
  let booted = await tryToBoot();
252
253
  if (booted) break;
253
254
  } catch (e) {
254
255
  console.error(e);
256
+ // If it's a cached failure, it might be that the cache is out of date, so rerun immediately without waiting or an error message.
257
+ if (cached) {
258
+ cachedConfig = undefined;
259
+ continue;
260
+ }
255
261
  }
256
262
  retryCount++;
257
263
  progressUI.setMessage(`No available servers, retried ${retryCount++} times`);
@@ -290,6 +296,7 @@ async function edgeNodeFunction(config: {
290
296
  }
291
297
  async function getEdgeNodeConfig(): Promise<EdgeNodeConfig> {
292
298
  let edgeIndex = cachedConfig || await (await fetch(config.edgeNodeConfigURL)).json() as EdgeNodesIndex;
299
+ cachedConfig = undefined;
293
300
 
294
301
  edgeIndex.edgeNodes.sort((a, b) => -(a.bootTime - b.bootTime));
295
302
  // Filter out duplicate hostnames (taking the max bootTime). We can't have multiple services using the same port, so duplicates are DEFINITELY dead. This fixes some issues with accessing old services, and generally makes reading the logs easier.
@@ -300,7 +307,6 @@ async function edgeNodeFunction(config: {
300
307
  return true;
301
308
  });
302
309
 
303
- cachedConfig = undefined;
304
310
  let liveHashForced = false;
305
311
  if (Date.now() < liveHashOverrideExpiryTime) {
306
312
  liveHashForced = true;
@@ -10,7 +10,7 @@ import { showModal } from "../5-diagnostics/Modal";
10
10
  import { qreact } from "../4-dom/qreact";
11
11
  import { liveHashOverrideURL } from "./edgeBootstrap";
12
12
  import { css } from "typesafecss";
13
- import { formatTime } from "socket-function/src/formatting/format";
13
+ import { formatNiceDateTime, formatTime } from "socket-function/src/formatting/format";
14
14
  import { delay } from "socket-function/src/batching";
15
15
  import { atomicObjectRead } from "../2-proxy/PathValueProxyWatcher";
16
16
 
@@ -109,8 +109,8 @@ function onLiveHashChange(liveHash: string, refreshThresholdTime: number) {
109
109
  <div className={css.vbox(10).maxWidth(250)}>
110
110
  <h3 className={css.margin(0)}>Server Update Available</h3>
111
111
  <div>The server has been updated. Please refresh the page to ensure you don't experience incompatibility issues.</div>
112
- {i !== notifyIntervals.length - 2 && <div>This notification will be shown again in {formatTime(waitDuration)}</div>}
113
- {i === notifyIntervals.length - 2 && <div>The page will automatically refresh in {formatTime(waitDuration)}</div>}
112
+ {i !== notifyIntervals.length - 2 && <div>This notification will be shown again at {formatNiceDateTime(Date.now() + waitDuration)}</div>}
113
+ {i === notifyIntervals.length - 2 && <div>The page will automatically refresh at {formatNiceDateTime(Date.now() + waitDuration)}</div>}
114
114
  </div>
115
115
  <div className={css.hbox(10).justifyContent("flex-end")}>
116
116
  <button
@@ -1,13 +1,7 @@
1
- 7) Broken loading of CYOA
2
- 1) Deploy (database functions)
3
- 2) deploy the CYOA service
4
- 3) Refresh the main page
5
- RESULT: It tries to access the specific hash, but it wasn't loaded serverside, so permissions are refused
6
-
7
- 8) Fix deploy user notification issue, where the refresh button doesn't work?
8
- - For application level updates
9
- - Just an application commit, then deploy the service, then the refresh button should show up, and work
1
+ Bug, if we refresh immediately after an update, we get into a state where we know we should be using a new hash, but the lookup for the hashes is cached, so we think the server doesn't exist,
2
+ - Hopefully it's just that we're using the cache we received from the server. If it's actually being cached in Cloudflare, that's annoying and I think we just need to fall back if we see the live hash has been updated recently. Although I don't think we're storing the timestamps so that's annoying.
10
3
 
4
+ 7) verify manually refreshing removes the message
11
5
 
12
6
  8) Use a special service for the HTTP bootstrapper, and then have 2 others that are on other ports
13
7
  --bootstraponly is added, and should work?