Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review: RAF unmount cleanup, joinUrl base-path preservation

[._.]/ Adam Eivy7203f1f06e64
diff --git a/client/src/pages/OpenClaw.jsx b/client/src/pages/OpenClaw.jsx
index b7d951a327..0b40fc0724 100644
--- a/client/src/pages/OpenClaw.jsx
+++ b/client/src/pages/OpenClaw.jsx
@@ -250,6 +250,12 @@ export default function OpenClaw() {
scrollAnimationFrameRef.current = null;
messagesEndRef.current?.scrollIntoView({ behavior: 'auto', block: 'end' });
});
+ return () => {
+ if (scrollAnimationFrameRef.current !== null) {
+ cancelAnimationFrame(scrollAnimationFrameRef.current);
+ scrollAnimationFrameRef.current = null;
+ }
+ };
}, [messages]);
useEffect(() => () => abortControllerRef.current?.abort(), []);
diff --git a/server/integrations/openclaw/api.js b/server/integrations/openclaw/api.js
index 2375143dc5..1175374d82 100644
--- a/server/integrations/openclaw/api.js
+++ b/server/integrations/openclaw/api.js
@@ -27,13 +27,12 @@ function pickFirst(...values) {
return undefined;
}
-function withLeadingSlash(path) {
- if (!path) return '';
- return path.startsWith('/') ? path : `/${path}`;
-}
-
function joinUrl(baseUrl, path) {
- return new URL(withLeadingSlash(path), baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`).toString();
+ const normalizedBase = baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`;
+ // Strip leading slashes from path so it joins relative to baseUrl's pathname
+ // (a leading slash would be treated as absolute, discarding any base path).
+ const relativePath = path ? path.replace(/^\/+/, '') : '';
+ return new URL(relativePath, normalizedBase).toString();
}
function parseUpstreamBody(text) {