From 28ee441d9a7ee5ac5b7fafee2edbf0741088bd7c Mon Sep 17 00:00:00 2001 From: giles Date: Sat, 7 Mar 2026 01:20:58 +0000 Subject: [PATCH] Debug: log fallback path when client route fails Co-Authored-By: Claude Opus 4.6 --- shared/static/scripts/sx-browser.js | 4 ++-- shared/sx/ref/orchestration.sx | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/shared/static/scripts/sx-browser.js b/shared/static/scripts/sx-browser.js index 74883ab..d8b3438 100644 --- a/shared/static/scripts/sx-browser.js +++ b/shared/static/scripts/sx-browser.js @@ -14,7 +14,7 @@ // ========================================================================= 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 isSxTruthy(x) { return x !== false && !isNil(x); } @@ -1940,7 +1940,7 @@ return postSwap(target); }); logInfo((String("sx:route trying ") + String(get(verbInfo, "url")))); 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); })(); }, (isSxTruthy(get(mods, "once")) ? {["once"]: true} : NIL)) : NIL); })(); }; diff --git a/shared/sx/ref/orchestration.sx b/shared/sx/ref/orchestration.sx index 81abd7d..59b422c 100644 --- a/shared/sx/ref/orchestration.sx +++ b/shared/sx/ref/orchestration.sx @@ -405,8 +405,9 @@ (browser-push-state (get verbInfo "url")) (browser-scroll-to 0 0)) (do - (when is-get-link - (log-info (str "sx:route server fetch " (get verbInfo "url")))) + (log-info (str "sx:route fallback is-get=" is-get-link + " url=" (get verbInfo "url") + " delay=" (get mods "delay"))) (if (get mods "delay") (do (clear-timeout timer)