From 9b1750e0ea44517b8455133611c2a379625a0758 Mon Sep 17 00:00:00 2001 From: bb2 <23148629+bb2@users.noreply.github.com> Date: Thu, 21 May 2026 19:24:12 +0800 Subject: [PATCH 1/2] UI: Avoid redundant URL completion in CollectionsScene **Problem Description:** Redundant URL completion in `CollectionsScene.js`. The file passes a `collection.href` that already contains the full path prefix to `UrlTextHandler.setHref`. Because `setHref` internally calls `completeHref` again, the path is double-completed (over-completed), resulting in a malformed URL. **Solution:** Instead of using `completeHref(collection.href)`, use `window.location.origin + collection.href` to manually construct the full URL, preventing the secondary completion bug. --- radicale/web/internal_data/js/scenes/CollectionsScene.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radicale/web/internal_data/js/scenes/CollectionsScene.js b/radicale/web/internal_data/js/scenes/CollectionsScene.js index d225d2d0..b02d3faa 100644 --- a/radicale/web/internal_data/js/scenes/CollectionsScene.js +++ b/radicale/web/internal_data/js/scenes/CollectionsScene.js @@ -268,7 +268,7 @@ export class CollectionsScene { } contentcount_form.textContent = contentcount_form_txt; } - let href = completeHref(collection.href); + let href = window.location.origin + collection.href; new UrlTextHandler(url_form, copy_btn).setHref(href); download_btn.href = href; download_btn.onclick = (event) => { @@ -361,4 +361,4 @@ export class CollectionsScene { return this._principal_collection.displayname; else return this._user; } -} \ No newline at end of file +} From 3c08b44b41ae4e40358ae45c671b3a920d22ab52 Mon Sep 17 00:00:00 2001 From: bb2 <23148629+bb2@users.noreply.github.com> Date: Fri, 22 May 2026 23:31:56 +0800 Subject: [PATCH 2/2] UI: remove unused completeHref import in CollectionsScene.js Fixes the JS Type Check error in CI after removing the completeHref function call. --- radicale/web/internal_data/js/scenes/CollectionsScene.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radicale/web/internal_data/js/scenes/CollectionsScene.js b/radicale/web/internal_data/js/scenes/CollectionsScene.js index b02d3faa..8fbdecfd 100644 --- a/radicale/web/internal_data/js/scenes/CollectionsScene.js +++ b/radicale/web/internal_data/js/scenes/CollectionsScene.js @@ -25,7 +25,7 @@ import { Collection, CollectionType, Permission } from "../models/collection.js" import { extract_title } from "../utils/collection_utils.js"; import { collectionsCache } from "../utils/collections_cache.js"; import { ErrorHandler } from "../utils/error.js"; -import { bytesToHumanReadable, completeHref, get_element, get_element_by_id } from "../utils/misc.js"; +import { bytesToHumanReadable, get_element, get_element_by_id } from "../utils/misc.js"; import { UrlTextHandler } from "../utils/url_text.js"; import { CreateEditCollectionScene } from "./CreateEditCollectionScene.js"; import { DeleteConfirmationScene } from "./DeleteConfirmationScene.js";