@jsenv/navi 0.29.309 → 0.29.311

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.
@@ -2866,7 +2866,17 @@ const updateActions = ({
2866
2866
  * - willRunSet: actions that will be run
2867
2867
  * - willPromoteSet: prerun actions that become run-requested
2868
2868
  * - stays*Set: actions that remain in their current state
2869
+ *
2870
+ * A proxy in any of the sets stands for the action it currently targets,
2871
+ * exactly as proxy.run()/rerun()/reset() do: what enters activationWeakSet
2872
+ * is always the target. A proxy kept in there would retarget on its own —
2873
+ * to a never-run child once its params go falsy — and getActivationInfo
2874
+ * would then meet an IDLE member on every later update of the document.
2869
2875
  */
2876
+ prerunSet = resolveActionProxies(prerunSet);
2877
+ runSet = resolveActionProxies(runSet);
2878
+ rerunSet = resolveActionProxies(rerunSet);
2879
+ resetSet = resolveActionProxies(resetSet);
2870
2880
 
2871
2881
  const { runningSet, settledSet } = getActivationInfo();
2872
2882
 
@@ -3088,13 +3098,6 @@ ${lines.join("\n")}`);
3088
3098
  // Step 5: Execute preruns and runs
3089
3099
  {
3090
3100
  const onActionToRunOrPrerun = (actionToPrerunOrRun, isPrerun) => {
3091
- if (actionToPrerunOrRun.isProxy) {
3092
- // maybe remove this check once the API is stable because
3093
- // nothing in the API should allow this to happen
3094
- throw new Error(
3095
- `Proxy should not be reach this point, use the underlying action instead`,
3096
- );
3097
- }
3098
3101
  const actionSpecificSignal = abortSignalMap.get(actionToPrerunOrRun);
3099
3102
  const effectiveSignal = actionSpecificSignal || abortSignal;
3100
3103
 
@@ -3222,6 +3225,14 @@ ${lines.join("\n")}`);
3222
3225
  };
3223
3226
  };
3224
3227
 
3228
+ const resolveActionProxies = (actionSet) => {
3229
+ const resolvedSet = new Set();
3230
+ for (const action of actionSet) {
3231
+ resolvedSet.add(action.isProxy ? action.getCurrentAction() : action);
3232
+ }
3233
+ return resolvedSet;
3234
+ };
3235
+
3225
3236
  const NO_PARAMS = { __no_params__: true };
3226
3237
  const mergeActionParams = (currentParams, newParams) => {
3227
3238
  // The order of these two checks is load-bearing. Checking `undefined` first
@@ -26281,6 +26292,22 @@ This prevents cross-test pollution and ensures clean state.`,
26281
26292
  // URL is the source of truth for explicit parameters
26282
26293
  const value = paramSignal.peek();
26283
26294
  if (urlParamValue === undefined) {
26295
+ // An address silent about a persisted search param leaves it
26296
+ // alone: the state already holds what is stored (it starts from
26297
+ // storage and every write goes back to it), and a reset here
26298
+ // would empty the storage as well. Reading the storage back is
26299
+ // not an option either: the write that removes the param from
26300
+ // the address is the one emptying its storage, and this sync can
26301
+ // run before that removal has happened.
26302
+ // A path segment or a pushed param names a place, and an address
26303
+ // without it is the place without it: those follow the address.
26304
+ if (
26305
+ connection.persists &&
26306
+ connection.paramType === "query" &&
26307
+ connection.history !== "push"
26308
+ ) {
26309
+ continue;
26310
+ }
26284
26311
  // No URL parameter - reset signal to its current default value
26285
26312
  // (handles both static fallback and dynamic default cases)
26286
26313
  const defaultValue = connection.getDefaultValue();