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 5E9911FF0AF for ; Thu, 08 Oct 2026 15:44:34 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id EE897202B8; Thu, 08 Oct 2026 15:44:33 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 08 Oct 2026 15:44:29 +0200 Message-Id: Subject: Re: [PATCH proxmox-widget-toolkit v2 19/34] notifications: matcher: add support for match expressions From: "Lukas Wagner" To: =?utf-8?q?Michael_K=C3=B6ppl?= , "Lukas Wagner" , , X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20261001083706.144246-1-l.wagner@proxmox.com> <20261001083706.144246-20-l.wagner@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1791467069753 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.203 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) POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium 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: 2R7BQDREH67SEJ6NPCWKZETIR7B6CYTR X-Message-ID-Hash: 2R7BQDREH67SEJ6NPCWKZETIR7B6CYTR X-MailFrom: l.wagner@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 Wed Oct 7, 2026 at 11:32 AM CEST, Michael K=C3=B6ppl wrote: > On Thu Oct 1, 2026 at 10:36 AM CEST, Lukas Wagner wrote: > > [snip] > >> + case 'one-of': >> + { >> + let children =3D []; >> + for (let child of value) { >> + children.push(visit(child)); >> + } >> + ret =3D { >> + type: key, >> + data: {}, >> + children, >> + leaf: false, >> + }; >> + } >> + break; >> + case 'not': >> + { >> + let child =3D visit(value); >> + ret =3D { >> + ...child, >> + invert: true, > > Shouldn't this be `invert: !child.invert`? Because right now, this will > remove any negations already in an expression. If I add an expression > as follows: > > pvesh create /cluster/notifications/matchers \ > --name double-not \ > --target mail-to-root \ > --disable 1 > --expression '{"not":{"not":{"match":{"type":"severity","severities":["= info"]}}}}' > > the PVE UI displays this as "Severity: all except info". When I then > edit e.g. the comment and save it, the expression does not match what I > originally created anymore. The result is then: > > pvesh get /cluster/notifications/matchers/test-double-not --output-format= json-pretty > { > "comment" : "test", > "digest" : "1d9913fd302f057e7749d88bad0dd3c8f567e5e6315e2e1e885d532102= c693ab", > "disable" : 1, > "expression" : "{\"not\":{\"match\":{\"type\":\"severity\",\"severitie= s\":[\"info\"]}}}", > "name" : "test-double-not", > "origin" : "user-created", > "target" : [ > "mail-to-root" > ] > } > > Similarly, `{"not":{"constant":false}}` becomes `{"constant":false}`. nice catch! I changed it as proposed by you and confirmed that it now works as expected. thanks!