From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id DDA3D1FF0E9 for ; Thu, 16 Jul 2026 10:50:29 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 7DAE221419; Thu, 16 Jul 2026 10:50:29 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 16 Jul 2026 10:49:49 +0200 Message-Id: From: =?utf-8?q?Michael_K=C3=B6ppl?= To: "Lukas Sichert" , Subject: Re: [PATCH manager v9 4/5] fix #7339: lvm: add discard-on-remove option to UI X-Mailer: aerc 0.21.0 References: <20260713160008.121125-1-l.sichert@proxmox.com> <20260713160008.121125-5-l.sichert@proxmox.com> In-Reply-To: <20260713160008.121125-5-l.sichert@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784191770451 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.356 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust 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: QRELPPS46V2B3MOJSBU4LJ4A3R27VZJN X-Message-ID-Hash: QRELPPS46V2B3MOJSBU4LJ4A3R27VZJN X-MailFrom: m.koeppl@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 VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon Jul 13, 2026 at 6:00 PM CEST, Lukas Sichert wrote: [snip] > + let onRemoveString =3D PVE.Parser.printPropertyString(onRemove); > + if (onRemoveString !=3D=3D '') { > + values['on-volume-remove'] =3D onRemoveString; > + } else if (!me.isCreate) { > + if (!values.delete) { > + values.delete =3D []; > + } > + values.delete.push('on-volume-remove'); `values.delete` is not guaranteed to be an array. In other places in pve-manager, we have explicit checks such as this one: ``` if (Array.isArray(values.delete)) { values.delete.push(key); } else { values.delete =3D [values.delete, key]; } ``` A consequence of this is that if you edit an existing LVM storage with snapshot-as-volume-chain and discard-on-remove unchecked, you cannot edit the storage, even if you changed another value. The "OK" button will simply not do anything. From just a quick glance at the code I think this is because in the StorageBase component's initComponent, there is a `deleteEmpty: !me.isCreate` for the snapshot-as-volume-chain checkbox added for LVM storages, which then results in values.delete being a string (?) instead of an array (it only becomes an array if more than 1 value is deleted). Adding a check like above should solve this. > + } > + > + return me.callParent([values]); > + }, > + [snip]