From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id C1DBD1FF138 for ; Wed, 04 Mar 2026 14:58:43 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6403EB0B8; Wed, 4 Mar 2026 14:59:48 +0100 (CET) From: Christian Ebner To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup v2 2/2] fix #7078: ui: exponse DeleteObjects via DeleteObject provider quirk Date: Wed, 4 Mar 2026 14:59:22 +0100 Message-ID: <20260304135922.717714-7-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260304135922.717714-1-c.ebner@proxmox.com> References: <20260304135922.717714-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1772632751669 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.053 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 Message-ID-Hash: MMPWTCM5DJYEVBMAXB5U7PDH5HCTU5WN X-Message-ID-Hash: MMPWTCM5DJYEVBMAXB5U7PDH5HCTU5WN X-MailFrom: c.ebner@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: The S3 compatible storage API for Google Cloud Storage does not implement deleteObjects api method, even if mentioned in the docs, although erratic [0] (incorrect anchor and docs switched with delete object ones at the time of last check). Provide users a workaround by allowing to set the provider quirk to perform individual deleteObject calls instead of deleteObjects on the list of objects to delete. The same quirk might also be used when delete object calls are monetarily cheaper as compared to the multi object deletion, at the cost of additional api calls and all the added delays that implies. As suggested when the provider quirks first got applied in [1], instead of exposing the additional quirk via an added entry to the dropdown selector, move to a fieldset with nested checkboxes for better accessibility. [0] https://cloud.google.com/distributed-cloud/hosted/docs/latest/gdch/apis/service/storage/storage-s3-rest-api#DeleteObjects [1] https://lore.proxmox.com/pbs-devel/175440823229.3188344.11268683178675917633.b4-ty@proxmox.com/ Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=7078 Signed-off-by: Christian Ebner --- changes since version 1: - no changes www/window/S3ClientEdit.js | 57 ++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/www/window/S3ClientEdit.js b/www/window/S3ClientEdit.js index 8862683b8..c7e8ade1f 100644 --- a/www/window/S3ClientEdit.js +++ b/www/window/S3ClientEdit.js @@ -135,20 +135,6 @@ Ext.define('PBS.window.S3ClientEdit', { emptyText: gettext('Unlimited'), submitAutoScaledSizeUnit: true, }, - { - xtype: 'proxmoxKVComboBox', - name: 'provider-quirks', - fieldLabel: gettext('Provider Quirks'), - value: '__default__', - defaultValue: '__default__', - comboItems: [ - ['__default__', gettext('None (default)')], - ['skip-if-none-match-header', gettext('Skip If-None-Match header')], - ], - cbind: { - deleteEmpty: '{!isCreate}', - }, - }, ], advancedColumn2: [ { @@ -166,6 +152,27 @@ Ext.define('PBS.window.S3ClientEdit', { submitAutoScaledSizeUnit: true, }, ], + advancedColumnB: [ + { + xtype: 'fieldset', + name: 'provider-quirks', + fieldLabel: gettext('Provider Quirks'), + items: [ + { + xtype: 'checkbox', + name: 'skip-if-none-match-header', + fieldLabel: gettext('Skip If-None-Match header'), + labelWidth: 200, + }, + { + xtype: 'checkbox', + name: 'delete-objects-via-delete-object', + fieldLabel: gettext('DeleteObjects via deleteObject'), + labelWidth: 200, + }, + ], + }, + ], }, getValues: function () { @@ -193,6 +200,28 @@ Ext.define('PBS.window.S3ClientEdit', { delete values['secret-key']; } + let quirks = []; + ['skip-if-none-match-header', 'delete-objects-via-delete-object'].forEach((quirk) => { + if (values[quirk]) { + quirks.push(quirk); + delete values[quirk]; + } + }); + + if (quirks.length > 0) { + values['provider-quirks'] = quirks; + } else if (!me.isCreate) { + values.delete.push('provider-quirks'); + } + return values; }, + + setValues: function (values) { + if (values['provider-quirks']) { + values['provider-quirks'].forEach((quirk) => (values[quirk] = true)); + } + + this.callParent(arguments); + }, }); -- 2.47.3