@jsenv/navi 0.30.22 → 0.30.24

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.
@@ -28155,7 +28155,7 @@ const createResourceLifecycleManager = () => {
28155
28155
 
28156
28156
  for (const restAction of config.restActionSet) {
28157
28157
  const actionCandidateArray = restAction.matchAllSelfOrDescendant(
28158
- (action) => isAnsweredOrAsking(action, triggeringAction),
28158
+ (action) => shouldAskAgain(action, triggeringAction),
28159
28159
  );
28160
28160
 
28161
28161
  for (const actionCandidate of actionCandidateArray) {
@@ -28195,7 +28195,7 @@ const createResourceLifecycleManager = () => {
28195
28195
  break delete_effect;
28196
28196
  }
28197
28197
  if (candidateIsPlural) {
28198
- if (!shouldRerunGetMany) {
28198
+ if (candidateVerb !== "GET" || !shouldRerunGetMany) {
28199
28199
  break delete_effect;
28200
28200
  }
28201
28201
  actionsToRerun.add(actionCandidate);
@@ -28337,7 +28337,7 @@ const createResourceLifecycleManager = () => {
28337
28337
  continue;
28338
28338
  }
28339
28339
  const instanceArray = dependentAction.matchAllSelfOrDescendant(
28340
- (action) => isAnsweredOrAsking(action, triggeringAction),
28340
+ (action) => shouldAskAgain(action, triggeringAction),
28341
28341
  );
28342
28342
  for (const instance of instanceArray) {
28343
28343
  actionsToRerun.add(instance);
@@ -28440,12 +28440,16 @@ const createResourceLifecycleManager = () => {
28440
28440
  };
28441
28441
  };
28442
28442
 
28443
- // A read to ask again after a write: answered before it landed, or still out —
28444
- // an answer that left before the write is as stale as a completed one, and
28445
- // would replace what the write put in the store (a rerun aborts it and asks
28446
- // again). A head start is its owner's to ask (findEffectOnActions resets it).
28447
- const isAnsweredOrAsking = (action, triggeringAction) =>
28448
- (action.completed || action.runningState === RUNNING) &&
28443
+ // A read to ask again after a write: answered before it landed, still out, or
28444
+ // failed. An answer that left before the write is as stale as a completed one,
28445
+ // and would replace what the write put in the store (a rerun aborts it and asks
28446
+ // again). A failed read has no other way back: only a write asks it again.
28447
+ // A head start is its owner's to ask: findEffectOnActions resets one holding an
28448
+ // answer, and one that failed stays FAILED (see prerunAhead in route_action.js).
28449
+ const shouldAskAgain = (action, triggeringAction) =>
28450
+ (action.completed ||
28451
+ action.runningState === RUNNING ||
28452
+ (action.runningState === FAILED && !action.isPrerunSignal.peek())) &&
28449
28453
  action !== triggeringAction;
28450
28454
  // A write named in `writes` says for itself which reads of its own resource it
28451
28455
  // reruns (`rerunOn: { GET_RANGE: true }`); a read it leaves out, and every read
@@ -41137,10 +41141,14 @@ const RouteTravel = ({
41137
41141
  const pages = pagesRef.current;
41138
41142
  const currentIndex = currentPageIndex(pages);
41139
41143
  // Where the page of a window stands: the address, or where it last was for an
41140
- // address the row has no place for.
41144
+ // address the row has no place for, while the row still has that column.
41141
41145
  const liveIndexRef = useRef(0);
41142
41146
  if (currentIndex !== -1) {
41143
41147
  liveIndexRef.current = currentIndex;
41148
+ } else if (liveIndexRef.current >= pages.length) {
41149
+ // Past the row's end the page stands in a column of its own, off screen: a
41150
+ // still row does not scroll, and nothing scrolls a row to an address it lacks.
41151
+ liveIndexRef.current = pages.length === 0 ? 0 : pages.length - 1;
41144
41152
  }
41145
41153
  const liveIndex = liveIndexRef.current;
41146
41154
  const latestRef = useRef(null);