From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 6AC391FF146 for ; Tue, 28 Apr 2026 13:30:23 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B811EF756; Tue, 28 Apr 2026 13:30:22 +0200 (CEST) Message-ID: <1caf3dc4-cc7e-4560-b37d-642cbd89a533@proxmox.com> Date: Tue, 28 Apr 2026 13:30:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-backup] ui: datastore content: fix namespace change after reload To: Dominik Csapak , pbs-devel@lists.proxmox.com References: <20260428110520.2343917-1-d.csapak@proxmox.com> Content-Language: en-US From: Filip Schauer In-Reply-To: <20260428110520.2343917-1-d.csapak@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777375718885 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.013 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [view.store] Message-ID-Hash: JIYEWCJ3UEC6JDZUUHU3EF23MU2LH6NO X-Message-ID-Hash: JIYEWCJ3UEC6JDZUUHU3EF23MU2LH6NO X-MailFrom: f.schauer@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 28/04/2026 13:03, Dominik Csapak wrote: > A double click on a namespace change it by first setting the namespace > value to the namespace selector and then triggering a reload. > > When a new namespace is added to the view with a manual click on > 'reload', this new namespace does not yet exist in the namespace > selectors store. So a double click can't properly set this as a value, > and thus does not change the namespace. > > To fix this, always reload the namespace selector at the beginning of a > reload, so they should be in sync. > > To keep the callback we use for the namespace selector, move it to the > reload function and pass it through to the load there. > > Signed-off-by: Dominik Csapak > --- > www/datastore/Content.js | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/www/datastore/Content.js b/www/datastore/Content.js > index b1e1f66cb..293f9ca26 100644 > --- a/www/datastore/Content.js > +++ b/www/datastore/Content.js > @@ -102,8 +102,11 @@ Ext.define('PBS.DataStoreContent', { > this.reload(); > }, > > - reload: function () { > + reload: function (nsLoadCallback) { > let view = this.getView(); > + view.down('pbsNamespaceSelector').store?.load({ > + callback: Ext.isFunction(nsLoadCallback) ? nsLoadCallback : undefined, > + }); > > if (!view.store || !this.store) { > console.warn('cannot reload, no store(s)'); > @@ -560,7 +563,6 @@ Ext.define('PBS.DataStoreContent', { > namespace: view.namespace ?? '', > apiCallDone: (success) => { > if (success) { > - view.down('pbsNamespaceSelector').store?.load(); > me.reload(); > } > }, > @@ -685,11 +687,8 @@ Ext.define('PBS.DataStoreContent', { > // selector's tree store does not know about the just-created target > // namespace yet. > view.namespace = newNs; > - me.reload(); > let selector = view.down('pbsNamespaceSelector'); > - selector?.store?.load({ > - callback: () => selector.setValue(newNs), > - }); > + me.reload(() => selector.setValue(newNs)); > } > }, > }); I can confirm that this fixes the bug where, after a new namespace was pushed to a datastore, it would appear in the content view when clicking "Reload", but double-clicking it did nothing until the entire page was refreshed. Now, this no longer happens, and I can immediately navigate into the namespace.