From de03cd4c58f2944bb4784ad33b0a55e0d86c4d7d Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 25 Jan 2026 21:14:05 +0000 Subject: [PATCH] fix(storage): ensure R2 public URL is saved to connection metadata When saving an R2 storage connection, the "Prefix" input (which holds the Public Bucket URL) was not being mapped to `meta.baseDomain` or `meta.publicBaseUrl`. This caused `R2Service.ensureBucketConfigForNpub` to throw "Public Bucket URL is missing" during upload preparation, as it relies on these properties. This commit updates `ProfileModalController.handleSaveStorage` to correctly assign the prefix value to `baseDomain` and `publicBaseUrl` for the `cloudflare_r2` provider, aligning it with the behavior for generic S3 providers and resolving the upload error. --- js/ui/profileModalController.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/ui/profileModalController.js b/js/ui/profileModalController.js index 409e9795..93463dc9 100644 --- a/js/ui/profileModalController.js +++ b/js/ui/profileModalController.js @@ -9224,6 +9224,9 @@ export class ProfileModalController { // We can store it in meta if we want to show it in UI without decrypting. if (provider === "cloudflare_r2") { meta.accountId = endpointOrAccount; + // For R2, the "Prefix" input serves as the Public Base URL (e.g. https://pub-xxx.r2.dev) + meta.publicBaseUrl = prefix; + meta.baseDomain = prefix; } else { meta.publicBaseUrl = publicBaseUrl; meta.baseDomain = publicBaseUrl;