@jsenv/navi 0.30.10 → 0.30.11

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.
@@ -4562,9 +4562,10 @@ const createAction = (callback, rootOptions = {}) => {
4562
4562
  }
4563
4563
  }
4564
4564
  runningStateSignal.value = RUNNING;
4565
- if (!isPrerun) {
4566
- isPrerunSignal.value = false;
4567
- }
4565
+ // What fills the instance says what it holds: an answer only a
4566
+ // prerun asked for is one nothing on screen has read yet, and the
4567
+ // run that asks for it next is promoted onto it (see updateActions).
4568
+ isPrerunSignal.value = isPrerun;
4568
4569
  });
4569
4570
 
4570
4571
  const args = [];
@@ -5375,10 +5376,16 @@ const actionRunEffect = (
5375
5376
  runUnwatched(() =>
5376
5377
  actionTarget.run({ reason: "params restored from falsy state" }),
5377
5378
  );
5378
- } else if (getActionPrivateProperties(actionTarget).keepsAnswers) {
5379
+ } else if (
5380
+ getActionPrivateProperties(actionTarget).keepsAnswers ||
5381
+ actionTarget.isPrerunSignal.peek()
5382
+ ) {
5379
5383
  // The lookup that moved the binding here already reset an answer
5380
5384
  // older than its `keep`: what the instance holds is still good, and
5381
- // a prerun still out is joined rather than asked again.
5385
+ // a prerun still out is joined rather than asked again. So is an
5386
+ // answer only a prerun asked for, kept or not: asked ahead for this
5387
+ // very arrival (a <RouteTravel prefetch> neighbour), nothing has read
5388
+ // it yet, and the run promotes it.
5382
5389
  runUnwatched(() => actionTarget.run({ reason: "params modified" }));
5383
5390
  } else {
5384
5391
  runUnwatched(() => actionTarget.rerun({ reason: "params modified" }));
@@ -29173,6 +29180,16 @@ const createResourceLifecycleManager = () => {
29173
29180
  }
29174
29181
  }
29175
29182
 
29183
+ // A head start the write made stale is dropped, not asked again: nothing
29184
+ // on screen reads it, and its owner, finding it idle, asks on arriving
29185
+ // instead of promoting what left before the write.
29186
+ for (const action of actionsToRerun) {
29187
+ if (action.isPrerunSignal.peek()) {
29188
+ actionsToRerun.delete(action);
29189
+ actionsToReset.add(action);
29190
+ }
29191
+ }
29192
+
29176
29193
  return {
29177
29194
  actionsToRerun,
29178
29195
  actionsToReset,
@@ -29260,9 +29277,8 @@ const createResourceLifecycleManager = () => {
29260
29277
  // A read to ask again after a write: answered before it landed, or still out —
29261
29278
  // an answer that left before the write is as stale as a completed one, and
29262
29279
  // would replace what the write put in the store (a rerun aborts it and asks
29263
- // again). A head start is its owner's to ask.
29280
+ // again). A head start is its owner's to ask (findEffectOnActions resets it).
29264
29281
  const isAnsweredOrAsking = (action, triggeringAction) =>
29265
- !action.isPrerun &&
29266
29282
  (action.completed || action.runningState === RUNNING) &&
29267
29283
  action !== triggeringAction;
29268
29284
  // A write named in `writes` says for itself which reads of its own resource it