@jsenv/navi 0.21.6 → 0.21.7

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.
@@ -12389,10 +12389,23 @@ const route = (pattern, { searchParams } = {}) => {
12389
12389
 
12390
12390
  // If we found a more specific route, delegate to it; otherwise handle it ourselves
12391
12391
  if (!isMostSpecificRoute) {
12392
- // Check if this is a signal-originated call and there's a more specific route that will also handle it
12393
- // If so, skip the redirect to avoid duplicate navTo calls
12392
+ // For signal-originated calls, only skip delegation if the more specific route
12393
+ // has its own signal connection for the same params meaning its own effect will
12394
+ // fire and handle the redirect. If it doesn't have the connection, the signal
12395
+ // change would be silently dropped, so we must delegate anyway.
12394
12396
  if (isSignalChange) {
12395
- return null;
12397
+ const mostSpecificRoutePrivateProperties =
12398
+ getRoutePrivateProperties(mostSpecificRoute);
12399
+ const { pathConnectionMap, queryConnectionMap } =
12400
+ mostSpecificRoutePrivateProperties.routePattern;
12401
+ const willHandleItself = Object.keys(newParams).every(
12402
+ (paramName) =>
12403
+ pathConnectionMap.has(paramName) ||
12404
+ queryConnectionMap.has(paramName),
12405
+ );
12406
+ if (willHandleItself) {
12407
+ return null;
12408
+ }
12396
12409
  }
12397
12410
  return mostSpecificRoute.redirectTo(newParams, {
12398
12411
  callReason: `replaceParams delegation from ${route} to ${mostSpecificRoute} (original reason: ${callReason})`,