@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.
@@ -4302,9 +4302,10 @@ const createAction = (callback, rootOptions = {}) => {
4302
4302
  }
4303
4303
  }
4304
4304
  runningStateSignal.value = RUNNING;
4305
- if (!isPrerun) {
4306
- isPrerunSignal.value = false;
4307
- }
4305
+ // What fills the instance says what it holds: an answer only a
4306
+ // prerun asked for is one nothing on screen has read yet, and the
4307
+ // run that asks for it next is promoted onto it (see updateActions).
4308
+ isPrerunSignal.value = isPrerun;
4308
4309
  });
4309
4310
 
4310
4311
  const args = [];
@@ -5106,10 +5107,16 @@ const actionRunEffect = (
5106
5107
  runUnwatched(() =>
5107
5108
  actionTarget.run({ reason: "params restored from falsy state" }),
5108
5109
  );
5109
- } else if (getActionPrivateProperties(actionTarget).keepsAnswers) {
5110
+ } else if (
5111
+ getActionPrivateProperties(actionTarget).keepsAnswers ||
5112
+ actionTarget.isPrerunSignal.peek()
5113
+ ) {
5110
5114
  // The lookup that moved the binding here already reset an answer
5111
5115
  // older than its `keep`: what the instance holds is still good, and
5112
- // a prerun still out is joined rather than asked again.
5116
+ // a prerun still out is joined rather than asked again. So is an
5117
+ // answer only a prerun asked for, kept or not: asked ahead for this
5118
+ // very arrival (a <RouteTravel prefetch> neighbour), nothing has read
5119
+ // it yet, and the run promotes it.
5113
5120
  runUnwatched(() => actionTarget.run({ reason: "params modified" }));
5114
5121
  } else {
5115
5122
  runUnwatched(() => actionTarget.rerun({ reason: "params modified" }));
@@ -28108,6 +28115,16 @@ const createResourceLifecycleManager = () => {
28108
28115
  }
28109
28116
  }
28110
28117
 
28118
+ // A head start the write made stale is dropped, not asked again: nothing
28119
+ // on screen reads it, and its owner, finding it idle, asks on arriving
28120
+ // instead of promoting what left before the write.
28121
+ for (const action of actionsToRerun) {
28122
+ if (action.isPrerunSignal.peek()) {
28123
+ actionsToRerun.delete(action);
28124
+ actionsToReset.add(action);
28125
+ }
28126
+ }
28127
+
28111
28128
  return {
28112
28129
  actionsToRerun,
28113
28130
  actionsToReset,
@@ -28195,9 +28212,8 @@ const createResourceLifecycleManager = () => {
28195
28212
  // A read to ask again after a write: answered before it landed, or still out —
28196
28213
  // an answer that left before the write is as stale as a completed one, and
28197
28214
  // would replace what the write put in the store (a rerun aborts it and asks
28198
- // again). A head start is its owner's to ask.
28215
+ // again). A head start is its owner's to ask (findEffectOnActions resets it).
28199
28216
  const isAnsweredOrAsking = (action, triggeringAction) =>
28200
- !action.isPrerun &&
28201
28217
  (action.completed || action.runningState === RUNNING) &&
28202
28218
  action !== triggeringAction;
28203
28219
  // A write named in `writes` says for itself which reads of its own resource it