strom-research 1.37.0-beta.5 → 1.37.0-beta.6
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/CHANGELOG.cs.md +1 -1
- package/CHANGELOG.de.md +1 -1
- package/CHANGELOG.md +1 -1
- package/CHANGELOG.pl.md +1 -1
- package/dist/core/deviceapp.js +34 -3
- package/dist/core/tree.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.cs.md
CHANGED
|
@@ -7,7 +7,7 @@ Změny každé verze ve zkratce. Úplné poznámky a instalační řádky jsou n
|
|
|
7
7
|
|
|
8
8
|
## 1.37.0
|
|
9
9
|
|
|
10
|
-
*Připravuje se: bety do 1.37.0-beta.
|
|
10
|
+
*Připravuje se: bety do 1.37.0-beta.6. Oddíl bude úplný s vydáním.*
|
|
11
11
|
|
|
12
12
|
- **Záznam archivu už nedrží portál ze seznamu stromu:** kniha s adresou na portálu, který seznam stromu zná (Porta
|
|
13
13
|
fontium, Acta Publica…), už nedělá portál tak přísný jako archiv, pod kterým je zapsaná – portál se řídí svými
|
package/CHANGELOG.de.md
CHANGED
|
@@ -7,7 +7,7 @@ Die Änderungen jeder Version in Kürze. Die vollständigen Hinweise und die Ins
|
|
|
7
7
|
|
|
8
8
|
## 1.37.0
|
|
9
9
|
|
|
10
|
-
*In Vorbereitung: die Betas bis 1.37.0-beta.
|
|
10
|
+
*In Vorbereitung: die Betas bis 1.37.0-beta.6. Der Abschnitt ist mit dem Release vollständig.*
|
|
11
11
|
|
|
12
12
|
- **Ein Archiveintrag der Forschung hält kein Portal der Liste von strom mehr:** ein Buch mit einer Adresse auf einem
|
|
13
13
|
Portal, das die Liste von strom kennt (Porta fontium, Acta Publica…), macht das Portal nicht mehr so streng wie das
|
package/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,7 @@ The changes of each version in short. The full notes and the install lines are o
|
|
|
7
7
|
|
|
8
8
|
## 1.37.0
|
|
9
9
|
|
|
10
|
-
*In preparation: the betas up to 1.37.0-beta.
|
|
10
|
+
*In preparation: the betas up to 1.37.0-beta.6. The section is complete with the release.*
|
|
11
11
|
|
|
12
12
|
- **A research's archive no longer holds a portal of strom's list:** a book whose address is on a portal strom's list
|
|
13
13
|
knows (Porta fontium, Acta Publica…) no longer makes the portal as strict as the archive the book is recorded under —
|
package/CHANGELOG.pl.md
CHANGED
|
@@ -7,7 +7,7 @@ Zmiany każdej wersji w skrócie. Pełne informacje o wydaniach i polecenia inst
|
|
|
7
7
|
|
|
8
8
|
## 1.37.0
|
|
9
9
|
|
|
10
|
-
*W przygotowaniu: bety do 1.37.0-beta.
|
|
10
|
+
*W przygotowaniu: bety do 1.37.0-beta.6. Sekcja będzie kompletna z wydaniem.*
|
|
11
11
|
|
|
12
12
|
- **Wpis archiwum w badaniu nie utrzymuje już portalu z listy stroma:** księga z adresem na portalu, który zna lista
|
|
13
13
|
stroma (Porta fontium, Acta Publica…), nie czyni już portalu tak surowym jak archiwum, pod którym jest zapisana –
|
package/dist/core/deviceapp.js
CHANGED
|
@@ -23,6 +23,11 @@ import { notePhone } from "./phone.js";
|
|
|
23
23
|
export const DEVICE_APP_EVERY_MS = 24 * 3600_000;
|
|
24
24
|
/** A download that failed is tried again after this long. */
|
|
25
25
|
export const DEVICE_APP_RETRY_MS = 3600_000;
|
|
26
|
+
/**
|
|
27
|
+
* The computer's app says a newer version than the copy: the site asked at once, not after a day — and while it still
|
|
28
|
+
* gives the older one (its release going on, a CDN), asked again at most once in this long; the copy kept meanwhile.
|
|
29
|
+
*/
|
|
30
|
+
export const DEVICE_APP_BEHIND_MS = 5 * 60_000;
|
|
26
31
|
export const INDEX_MAX = 40 * 1024 * 1024;
|
|
27
32
|
export const MANIFEST_MAX = 64 * 1024;
|
|
28
33
|
export const ICON_MAX = 1024 * 1024;
|
|
@@ -218,9 +223,23 @@ function parseShasums(text) {
|
|
|
218
223
|
return out;
|
|
219
224
|
}
|
|
220
225
|
const sha256 = (b) => crypto.createHash("sha256").update(b).digest("hex");
|
|
226
|
+
/**
|
|
227
|
+
* The newer version the computer's app said than the copy kept (source.appVersion): the version, or undefined (none
|
|
228
|
+
* said, not a version, the same or older).
|
|
229
|
+
*/
|
|
230
|
+
function behind(n, version) {
|
|
231
|
+
const said = n.source?.appVersion;
|
|
232
|
+
return version && said && isAppVersion(said) && compareVersions(said, version) > 0 ? said : undefined;
|
|
233
|
+
}
|
|
234
|
+
const within = (t, at, ms) => {
|
|
235
|
+
const a = at ? Date.parse(at) : NaN;
|
|
236
|
+
return Number.isFinite(a) && t >= a && t - a < ms;
|
|
237
|
+
};
|
|
221
238
|
/**
|
|
222
239
|
* The copy of the app for the devices made sure of: only while devices.mode is on (off — not one request), the site
|
|
223
|
-
* asked at most once a day (its ETag: 304 — kept as it is)
|
|
240
|
+
* asked at most once a day (its ETag: 304 — kept as it is) — at once where the computer's app says a newer version than
|
|
241
|
+
* the copy, then at most once in DEVICE_APP_BEHIND_MS while the site still gives the older one (the copy never removed
|
|
242
|
+
* for it) —, one download at a time (another running — busy). The
|
|
224
243
|
* index (≤ 40 MB, text/html, its version in it), the manifest (optional, ≤ 64 KB) and up to 8 icons it names (PNG, SVG,
|
|
225
244
|
* WebP, ≤ 1 MB each, only under the app's own path — any other skipped); SHASUMS256.txt beside them checked where the
|
|
226
245
|
* site has one (404: TLS alone; a sum that does not hold — nothing kept). Written whole (a temporary folder renamed),
|
|
@@ -239,9 +258,12 @@ export async function ensureDeviceApp(env, opts = {}) {
|
|
|
239
258
|
// say the site of: downloaded again, at once
|
|
240
259
|
const source = deviceAppSource(env);
|
|
241
260
|
const sameSite = !source || !kept || kept.from === new URL(source).origin;
|
|
242
|
-
|
|
261
|
+
// the computer's app says a newer version than the copy: asked at once — unless asked for that version lately
|
|
262
|
+
const newer = sameSite ? behind(n, kept?.version) : undefined;
|
|
263
|
+
const fresh = newer ? n.sought?.version === newer && within(t, n.sought.at, DEVICE_APP_BEHIND_MS) : within(t, n.checkedAt, DEVICE_APP_EVERY_MS);
|
|
264
|
+
if (kept && sameSite && fresh)
|
|
243
265
|
return { result: "fresh", version: kept.version };
|
|
244
|
-
if (
|
|
266
|
+
if (within(t, n.failedAt, DEVICE_APP_RETRY_MS))
|
|
245
267
|
return { result: "failed", error: n.error ?? "failed lately" };
|
|
246
268
|
try {
|
|
247
269
|
release = acquireLock(file(env, "device-app.fetch.lock"), { owner: "the app for the devices downloaded", waitMs: 0, staleMs: 30 * 60_000 });
|
|
@@ -252,6 +274,15 @@ export async function ensureDeviceApp(env, opts = {}) {
|
|
|
252
274
|
throw err;
|
|
253
275
|
}
|
|
254
276
|
const result = await download(env, kept, now, sameSite);
|
|
277
|
+
if (result.result === "unchanged" || result.result === "fetched") {
|
|
278
|
+
// the site still gives an older version than the computer's app says: asked again after DEVICE_APP_BEHIND_MS
|
|
279
|
+
const still = behind(readNote(env), result.version);
|
|
280
|
+
writeNote(env, (x) => {
|
|
281
|
+
if (!still && !x.sought)
|
|
282
|
+
return undefined;
|
|
283
|
+
return { ...x, sought: still ? { version: still, at: new Date(now()).toISOString() } : undefined };
|
|
284
|
+
});
|
|
285
|
+
}
|
|
255
286
|
if (result.result === "failed") {
|
|
256
287
|
writeNote(env, (x) => ({ ...x, failedAt: new Date(now()).toISOString(), error: result.error }));
|
|
257
288
|
notePhone(env, `the app for the devices not downloaded: ${result.error}`);
|
package/dist/core/tree.js
CHANGED
|
@@ -32,7 +32,7 @@ export const TREE_FILE = "strom.json";
|
|
|
32
32
|
export const SEAL_FOREIGN = "seal.foreign";
|
|
33
33
|
// between releases the candidate being made (a bridge run from the sources says what it is: the Strom app goes by it);
|
|
34
34
|
// at a release the release's own (package.json)
|
|
35
|
-
export const VERSION = "1.37.0-beta.
|
|
35
|
+
export const VERSION = "1.37.0-beta.6";
|
|
36
36
|
/** What a new research is settled with from the start: nothing an older strom counted otherwise to set right in it. */
|
|
37
37
|
export const NEW_TREE_SETTLED = ["readers-1", "proven-originals-1", "origins-1", "verify-originals-1", "origins-tree-1", "name-status-1"];
|
|
38
38
|
const GITIGNORE = `# Strom Research — local state and large files are not versioned
|