querysub 0.268.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.268.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;
@@ -1,7 +1,7 @@
1
- 8) Fix deploy user notification issue, where the refresh button doesn't work?
2
- - For application level updates
3
- - 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.
4
3
 
4
+ 7) verify manually refreshing removes the message
5
5
 
6
6
  8) Use a special service for the HTTP bootstrapper, and then have 2 others that are on other ports
7
7
  --bootstraponly is added, and should work?