Debug: log fallback path when client route fails

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 01:20:58 +00:00
parent 1387d97c82
commit 28ee441d9a
2 changed files with 5 additions and 4 deletions

View File

@@ -14,7 +14,7 @@
// ========================================================================= // =========================================================================
var NIL = Object.freeze({ _nil: true, toString: function() { return "nil"; } }); var NIL = Object.freeze({ _nil: true, toString: function() { return "nil"; } });
var SX_VERSION = "2026-03-07T01:16:18Z"; var SX_VERSION = "2026-03-07T01:20:58Z";
function isNil(x) { return x === NIL || x === null || x === undefined; } function isNil(x) { return x === NIL || x === null || x === undefined; }
function isSxTruthy(x) { return x !== false && !isNil(x); } function isSxTruthy(x) { return x !== false && !isNil(x); }
@@ -1940,7 +1940,7 @@ return postSwap(target); });
logInfo((String("sx:route trying ") + String(get(verbInfo, "url")))); logInfo((String("sx:route trying ") + String(get(verbInfo, "url"))));
clientRouted = tryClientRoute(urlPathname(get(verbInfo, "url")), domGetAttr(el, "sx-target")); clientRouted = tryClientRoute(urlPathname(get(verbInfo, "url")), domGetAttr(el, "sx-target"));
} }
return (isSxTruthy(clientRouted) ? (browserPushState(get(verbInfo, "url")), browserScrollTo(0, 0)) : ((isSxTruthy(isGetLink) ? logInfo((String("sx:route server fetch ") + String(get(verbInfo, "url")))) : NIL), (isSxTruthy(get(mods, "delay")) ? (clearTimeout_(timer), (timer = setTimeout_(function() { return executeRequest(el, verbInfo, NIL); }, get(mods, "delay")))) : executeRequest(el, verbInfo, NIL)))); return (isSxTruthy(clientRouted) ? (browserPushState(get(verbInfo, "url")), browserScrollTo(0, 0)) : (logInfo((String("sx:route fallback is-get=") + String(isGetLink) + String(" url=") + String(get(verbInfo, "url")) + String(" delay=") + String(get(mods, "delay")))), (isSxTruthy(get(mods, "delay")) ? (clearTimeout_(timer), (timer = setTimeout_(function() { return executeRequest(el, verbInfo, NIL); }, get(mods, "delay")))) : executeRequest(el, verbInfo, NIL))));
})()) : NIL); })()) : NIL);
})(); }, (isSxTruthy(get(mods, "once")) ? {["once"]: true} : NIL)) : NIL); })(); }, (isSxTruthy(get(mods, "once")) ? {["once"]: true} : NIL)) : NIL);
})(); }; })(); };

View File

@@ -405,8 +405,9 @@
(browser-push-state (get verbInfo "url")) (browser-push-state (get verbInfo "url"))
(browser-scroll-to 0 0)) (browser-scroll-to 0 0))
(do (do
(when is-get-link (log-info (str "sx:route fallback is-get=" is-get-link
(log-info (str "sx:route server fetch " (get verbInfo "url")))) " url=" (get verbInfo "url")
" delay=" (get mods "delay")))
(if (get mods "delay") (if (get mods "delay")
(do (do
(clear-timeout timer) (clear-timeout timer)