@opendatalabs/personal-server-ts-core 1.38.0 → 1.38.1

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.
@@ -50,9 +50,11 @@
50
50
  * - A load that fails leaves the authority unloaded: `read` stays `unknown`
51
51
  * for every owner, `submitEvidence` saves nothing, and the next
52
52
  * `submitEvidence` retries the load before judging the evidence. The answers
53
- * that arrive meanwhile are held as a three-value summary per owner (`held`
54
- * below) and applied when the records load; the owner has no permission
55
- * until the summary is saved and its latest answer is judged.
53
+ * that arrive meanwhile are held in arrival order, across owners (`held`
54
+ * below), and applied when the records load, each as a live answer is; an
55
+ * owner has no permission until they are all applied. A submission that
56
+ * loads the records returns only after that, with the decision a write then
57
+ * meets.
56
58
  * - `submitEvidence` takes the lock exclusively, saves the new record, then
57
59
  * publishes it. A save that fails throws; the record in memory stays as it
58
60
  * was, and legacy-write permission is withdrawn for that owner (above).
@@ -1 +1 @@
1
- {"version":3,"file":"authority.d.ts","sourceRoot":"","sources":["../../../src/sync/account-mode/authority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AAEH,OAAO,EAML,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AAsBrB,MAAM,MAAM,YAAY,CAAC,CAAC,IACxB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAA;CAAE,CAAC;AAEnE,iEAAiE;AACjE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,EAAE,IAAI,GAAG,KAAK,GAAG,SAAS,CAAC;IAChC,sBAAsB;IACtB,UAAU,CAAC,EAAE,M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,EAAE,eAAe,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACzD;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,oBAAoB,GAC5B,aAAa,CAmYf"}
@@ -50,9 +50,11 @@
50
50
  * - A load that fails leaves the authority unloaded: `read` stays `unknown`
51
51
  * for every owner, `submitEvidence` saves nothing, and the next
52
52
  * `submitEvidence` retries the load before judging the evidence. The answers
53
- * that arrive meanwhile are held as a three-value summary per owner (`held`
54
- * below) and applied when the records load; the owner has no permission
55
- * until the summary is saved and its latest answer is judged.
53
+ * that arrive meanwhile are held in arrival order, across owners (`held`
54
+ * below), and applied when the records load, each as a live answer is; an
55
+ * owner has no permission until they are all applied. A submission that
56
+ * loads the records returns only after that, with the decision a write then
57
+ * meets.
56
58
  * - `submitEvidence` takes the lock exclusively, saves the new record, then
57
59
  * publishes it. A save that fails throws; the record in memory stays as it
58
60
  * was, and legacy-write permission is withdrawn for that owner (above).
@@ -106,44 +108,40 @@ export function createModeAuthority(options) {
106
108
  * restarts, the permission is never wider than the one the same answers give
107
109
  * with the records readable throughout (the oracle: `applyAnswer` and one
108
110
  * save attempt per answer, in arrival order), and it is equal when no save
109
- * fails. `authority.test.ts` checks it against a seeded model.
111
+ * fails. A submission returns the decision a legacy write then meets. Every
112
+ * On this process applies, live or after the records load, wakes the import.
113
+ * `authority.test.ts` checks it against a seeded model, failures counted
114
+ * over all saves.
110
115
  *
111
- * Why. The record `applyAnswer` leaves is a fold of the answers that does
112
- * not depend on their order: its generation is the highest seen, and its
113
- * state is On exactly when an On was seen at that generation (On latches; a
114
- * higher generation replaces). Two answers give the same fold as all of
115
- * them: the On at the highest On generation (`onGen`), then the Off at the
116
- * highest generation (`maxGen`) when that is higher. Both arrived, and both
117
- * go through `applyAnswer` and the store like a live answer. Refusing
118
- * legacy writes is always safe, so wider is the only fault, and On means
119
- * refused (`read` is `streams`, `commitLegacy` gives 426).
116
+ * One path enforces it. An answer that cannot be judged (the records will
117
+ * not load) is held as it arrived, and when they load `replayHeld` applies
118
+ * it with `judge`, the call a live answer makes: one save attempt, and a
119
+ * failed save withdraws the permission and moves on. So recovery makes the
120
+ * save attempts the readable store makes, in the order it makes them (the
121
+ * order of arrival over all owners: a failure is a property of the store's
122
+ * n-th save, not of one owner's), and meets the same failures however the
123
+ * store counts them. A shortcut that applies fewer or other answers, or
124
+ * the same ones in another order (a fold of them, or one owner's after
125
+ * another's), makes other attempts, meets other failures, and can save an
126
+ * answer the readable store lost.
120
127
  *
121
- * - No save fails: the two saves leave the oracle's record, and the latest
122
- * answer gets the live rule: lift when it is the latest ticket and not
123
- * older than the record. Same permission.
124
- * - A save fails: the summary stays held, so the owner has no permission
125
- * (`legacyWriteDecision` is `unknown`), and nothing is judged past the
126
- * failed save: no later Off lifts past an On that is not saved. It is
127
- * applied again at the next load check or answer. The permission returns
128
- * only when the record holds the whole fold. Where the oracle's own saves
129
- * failed, its record has less than the fold. A missing On leaves it wider
130
- * than this side, so this side is stricter. A missing Off at `maxGen` would
131
- * leave it narrower, so an Off at `maxGen` is attempted once per Off that
132
- * arrived (`offAttempts`), the count the oracle makes: it cannot get
133
- * through a save failure that the oracle's attempts did not get through.
134
- * The On has no such count: trying it again can only refuse more.
135
- * - A new answer while a summary is held joins it, and is not judged
136
- * ahead of it.
137
- * - Restart: the summary is in memory only, like a withdrawal. After the
138
- * summary is saved a restart reads the oracle's record. A restart while it
139
- * is unsaved loses an answer that no process could keep, since it arrived
140
- * while the records would not load or its save failed; the registry
141
- * refuses legacy writes once the owner is On.
128
+ * Restart: held answers are in memory only. One a restart loses was given
129
+ * while the records would not load, so no process could keep it; the
130
+ * registry refuses legacy writes once the owner is On.
142
131
  *
143
- * The memory is two numbers, a counter and the latest answer per owner,
144
- * however many answers arrive.
132
+ * The memory is one small run per change of answer (or of owner) while the
133
+ * records will not load, not one per poll. It has no bound of its own, on
134
+ * purpose: whether an answer makes a save attempt depends on whether the
135
+ * saves before it failed, which is not known until the records load, so no
136
+ * run can be dropped or merged without changing the attempts that follow it
137
+ * and so, under some failure, the decision (a bound of 64 runs per owner
138
+ * once did this: it kept the highest On and let a failed save of that On
139
+ * lift an Off the readable store had refused). The runs are bounded by how
140
+ * often the Account changes its answer while the store is down.
145
141
  */
146
- const held = new Map();
142
+ let held = [];
143
+ /** The owners with a run in `held`: they have no permission. */
144
+ const heldOwners = new Set();
147
145
  let loaded = false;
148
146
  let loadFailed = false;
149
147
  let closed = false;
@@ -193,7 +191,7 @@ export function createModeAuthority(options) {
193
191
  return key !== null &&
194
192
  !withdrawn.has(key) &&
195
193
  !unsettled.has(key) &&
196
- !held.has(key)
194
+ !heldOwners.has(key)
197
195
  ? decision
198
196
  : UNKNOWN_DECISION;
199
197
  }
@@ -250,27 +248,20 @@ export function createModeAuthority(options) {
250
248
  withdrawn.add(owner);
251
249
  }
252
250
  function hold(owner, answer) {
253
- const summary = held.get(owner);
254
- if (!summary) {
255
- held.set(owner, {
256
- onGen: answer.state === "on" ? answer.generation : -1,
257
- maxGen: answer.generation,
258
- offAttempts: answer.state === "off" ? 1 : 0,
259
- latest: answer,
260
- });
251
+ heldOwners.add(owner);
252
+ // Only the run just before it can absorb it: an answer of another owner
253
+ // between two of this owner's keeps them apart, as the readable store
254
+ // spends a save attempt between them.
255
+ const last = held[held.length - 1];
256
+ if (last &&
257
+ last.owner === owner &&
258
+ last.state === answer.state &&
259
+ last.generation === answer.generation) {
260
+ last.count += 1;
261
+ last.ticket = answer.ticket;
261
262
  return;
262
263
  }
263
- if (answer.generation > summary.maxGen) {
264
- summary.maxGen = answer.generation;
265
- summary.offAttempts = 0;
266
- }
267
- if (answer.state === "on") {
268
- summary.onGen = Math.max(summary.onGen, answer.generation);
269
- }
270
- else if (answer.generation === summary.maxGen) {
271
- summary.offAttempts += 1;
272
- }
273
- summary.latest = answer;
264
+ held.push({ owner, ...answer, count: 1 });
274
265
  }
275
266
  /** Apply one answer to the loaded record and save it; throws if the save does. */
276
267
  async function applySaved(owner, state, generation) {
@@ -283,46 +274,37 @@ export function createModeAuthority(options) {
283
274
  return next;
284
275
  }
285
276
  /**
286
- * Apply every held summary, now that records are loaded: the On at its
287
- * highest generation, then the Off at the highest generation when that is
288
- * higher, then judge the latest answer against the record those leave, by
289
- * the live rule. Under the lock. A save that fails stops the owner's
290
- * summary where it is: it stays held, and nothing after it is judged. An
291
- * entry is removed in the same step that applies its effect, with nothing
292
- * awaited between, so no check sees an owner that is judged but not settled
293
- * as free.
277
+ * Apply every held answer, now that the records are loaded, in arrival
278
+ * order over all owners, each through `judge` as a live answer is. A save
279
+ * that fails withdraws its owner and the next answer is applied, as on the
280
+ * readable path. The owners are released together, once the last answer is
281
+ * applied, with nothing awaited between, so no check sees an owner that is
282
+ * judged but not settled as free. Adds to `woken` each owner an applied
283
+ * answer left On. Under the lock.
294
284
  */
295
- async function replayHeld() {
296
- for (const [owner, summary] of [...held]) {
297
- try {
298
- if (summary.onGen >= 0)
299
- await applySaved(owner, "on", summary.onGen);
300
- const record = records.get(owner);
301
- if (applyAnswer(record, "off", summary.maxGen, 0) !== record &&
302
- summary.offAttempts > 0) {
303
- summary.offAttempts -= 1;
304
- await applySaved(owner, "off", summary.maxGen);
285
+ async function replayHeld(woken) {
286
+ // Only an owner's last answer's effect counts: an older one is no longer
287
+ // the latest, so it can only withdraw.
288
+ const effects = new Map();
289
+ for (const run of held) {
290
+ let effect = "withdraw";
291
+ for (let n = 1; n <= run.count; n += 1) {
292
+ try {
293
+ effect = await judge(run.owner, run.state, run.generation, n === run.count ? run.ticket : 0);
294
+ if (records.get(run.owner)?.answer === "on")
295
+ woken.add(run.owner);
296
+ }
297
+ catch (error) {
298
+ warn("a held answer could not be saved", error);
299
+ effect = "withdraw";
305
300
  }
306
301
  }
307
- catch (error) {
308
- warn("a held answer could not be saved", error);
309
- continue;
310
- }
311
- const record = records.get(owner);
312
- const complete = (summary.onGen < 0 ||
313
- applyAnswer(record, "on", summary.onGen, 0) === record) &&
314
- applyAnswer(record, "off", summary.maxGen, 0) === record;
315
- // An Off at `maxGen` that arrived and could not be saved is not retried
316
- // until another one arrives: the owner stays held.
317
- if (!complete || !record)
318
- continue;
319
- const { latest: last } = summary;
320
- applyEffect(owner, latest.get(owner) === last.ticket &&
321
- last.generation >= record.generation
322
- ? "lift"
323
- : "withdraw");
324
- held.delete(owner);
302
+ effects.set(run.owner, effect);
325
303
  }
304
+ for (const [owner, effect] of effects)
305
+ applyEffect(owner, effect);
306
+ held = [];
307
+ heldOwners.clear();
326
308
  }
327
309
  return {
328
310
  ready,
@@ -340,73 +322,80 @@ export function createModeAuthority(options) {
340
322
  pending.add(ticket);
341
323
  unsettled.set(owner, pending);
342
324
  }
343
- if (answered) {
344
- // Settled in the `finally`, under the lock, whatever happens.
345
- let release;
346
- // Withdraw until the answer is judged: a throw anywhere before that
347
- // (a save that failed) leaves the owner without permission.
348
- let effect = "withdraw";
349
- try {
350
- await ready;
351
- release = await lock.exclusive();
352
- // Retried under the lock, so the exclusive request is queued before
353
- // the load starts: an On still waits for legacy writes in flight,
354
- // and no legacy write starts after it.
355
- await retryLoadIfFailed();
356
- const answer = {
357
- state: input.state,
358
- generation: input.generation ?? 0,
359
- ticket,
360
- };
361
- if (loadFailed || held.has(owner)) {
362
- // No records to judge against, or an earlier answer is still
363
- // waiting to be saved: this one joins it. Nothing is judged ahead
364
- // of the summary, so no Off can lift past an On that is not saved.
365
- hold(owner, answer);
366
- if (!loadFailed)
367
- await replayHeld();
368
- effect = "keep";
369
- return read(owner);
370
- }
371
- await replayHeld();
372
- effect = await judge(owner, answer.state, answer.generation, ticket);
373
- }
374
- finally {
375
- // The release comes last, whatever the bookkeeping does.
325
+ // Owners the import must be woken for, after the lock is released.
326
+ const woken = new Set();
327
+ try {
328
+ if (answered) {
329
+ // Settled in the `finally`, under the lock, whatever happens.
330
+ let release;
331
+ // Withdraw until the answer is judged: a throw anywhere before that
332
+ // (a save that failed) leaves the owner without permission.
333
+ let effect = "withdraw";
376
334
  try {
377
- applyEffect(owner, effect);
378
- settle(owner, ticket);
335
+ await ready;
336
+ release = await lock.exclusive();
337
+ // Retried under the lock, so the exclusive request is queued
338
+ // before the load starts: an On still waits for legacy writes in
339
+ // flight, and no legacy write starts after it.
340
+ await retryLoadIfFailed();
341
+ const answer = {
342
+ state: input.state,
343
+ generation: input.generation ?? 0,
344
+ ticket,
345
+ };
346
+ if (loadFailed) {
347
+ // No records to judge against: held, and judged when they load.
348
+ hold(owner, answer);
349
+ effect = "keep";
350
+ }
351
+ else {
352
+ // Earlier held answers first, then this one, by the same path.
353
+ await replayHeld(woken);
354
+ effect = await judge(owner, answer.state, answer.generation, ticket);
355
+ }
379
356
  }
380
357
  finally {
381
- release?.();
358
+ // The release comes last, whatever the bookkeeping does.
359
+ try {
360
+ applyEffect(owner, effect);
361
+ settle(owner, ticket);
362
+ }
363
+ finally {
364
+ release?.();
365
+ }
382
366
  }
383
367
  }
368
+ else {
369
+ await ready;
370
+ await retryLoadIfFailed();
371
+ // A failed read adds no answer, but a load it triggered must still
372
+ // judge the answers held while the records were unreadable.
373
+ if (loaded && !loadFailed && held.length > 0) {
374
+ const release = await lock.exclusive();
375
+ try {
376
+ await replayHeld(woken);
377
+ }
378
+ finally {
379
+ release();
380
+ }
381
+ }
382
+ }
383
+ // After the answer settled: what a write meets now, never `read`.
384
+ const decision = legacyWriteDecision(owner);
385
+ if (decision.kind === "streams")
386
+ woken.add(owner);
387
+ return decision;
384
388
  }
385
- else {
386
- await ready;
387
- await retryLoadIfFailed();
388
- // A failed read adds no answer, but a load it triggered must still
389
- // judge the answers held while the records were unreadable.
390
- if (loaded && !loadFailed && held.size > 0) {
391
- const release = await lock.exclusive();
389
+ finally {
390
+ for (const woke of woken) {
392
391
  try {
393
- await replayHeld();
392
+ options.onOn?.(woke);
394
393
  }
395
- finally {
396
- release();
394
+ catch (error) {
395
+ warn("the On callback failed", error);
397
396
  }
398
397
  }
399
398
  }
400
- const decision = legacyWriteDecision(owner);
401
- if (decision.kind === "streams") {
402
- try {
403
- options.onOn?.(owner);
404
- }
405
- catch (error) {
406
- warn("the On callback failed", error);
407
- }
408
- }
409
- return decision;
410
399
  },
411
400
  async commitLegacy(owner, write) {
412
401
  // An answer that has arrived and is not applied yet may contradict the
@@ -1 +1 @@
1
- {"version":3,"file":"authority.js","sourceRoot":"","sources":["../../../src/sync/account-mode/authority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AAEH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,cAAc,GAKf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAoE5C,MAAM,UAAU,mBAAmB,CACjC,OAA6B;IAE7B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC;IACpC,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,IAAI,GAAG,EAA6B,CAAC;IACrD,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC;IAC5B;;;;;;;;OAQG;IACH,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;IACpC;;;;;OAKG;IACH,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB;;;;OAIG;IACH,MAAM,SAAS,GAAG,IAAI,GAAG,EAAuB,CAAC;IACjD,MAAM,aAAa,GAAG,IAAI,GAAG,EAG1B,CAAC;IACJ;;;;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