From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 250D7750BD for ; Wed, 23 Jun 2021 13:36:30 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 197AAA53B for ; Wed, 23 Jun 2021 13:36:30 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 1D5A8A52D for ; Wed, 23 Jun 2021 13:36:29 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id D6FC244320 for ; Wed, 23 Jun 2021 13:36:28 +0200 (CEST) Message-ID: <3b796e75-9cd9-6074-a289-766c42cf7ea8@proxmox.com> Date: Wed, 23 Jun 2021 13:36:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Thunderbird/90.0 Content-Language: en-US To: Proxmox VE development discussion , Aaron Lauterer References: <20210623100444.1440650-1-a.lauterer@proxmox.com> From: Thomas Lamprecht In-Reply-To: <20210623100444.1440650-1-a.lauterer@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.405 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_NUMSUBJECT 0.5 Subject ends in numbers excluding current years SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] applied-series: [PATCH series/flutter 0/4] fixes related to PVE 7 X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2021 11:36:30 -0000 On 23.06.21 12:04, Aaron Lauterer wrote: > This series contains a few fixes for problems that I came across when > testing the flutter app against Proxmox VE 7. > > The first bigger one, affecting the first 3 patches, is handling of > different types when parsing API responses. The PVE API is not always > returning the expected type. In most situations it is numbers formatted > as strings instead of numbers. > > For dynamically types languages this is usually much less of a problem > as it is in statically typed languages as dart. > To handle that, I introduced new custom serializers for Strings, > integers and doubles. If the value is not of the expected type, they > should be able to handle situations where the number is formatted as > string or where the expected string is formatted as number and > cast/parse them accordingly. > > The last patch addresses a problem that showed up when trying to open > the power menu for a guest that had been powered off. The handling of > the states template value being null has not been done correctly. I used > the same approach as throughout the other parts where the template > status is checked -> falling back to false. > > dart_api_client: Aaron Lauterer (3): > Add string serializer to handle int and double values > Add int serializer to handle string values > Add double serializer to handle String and int values > > lib/src/models/pve_double_serializer.dart | 28 +++++++++++++++++++++++ > lib/src/models/pve_int_serializer.dart | 25 ++++++++++++++++++++ > lib/src/models/pve_string_serializer.dart | 25 ++++++++++++++++++++ > lib/src/models/serializers.dart | 6 +++++ > 4 files changed, 84 insertions(+) > create mode 100644 lib/src/models/pve_double_serializer.dart > create mode 100644 lib/src/models/pve_int_serializer.dart > create mode 100644 lib/src/models/pve_string_serializer.dart > > flutter_frontend: Aaron Lauterer (1): > power settings: fix handling null for template status > > lib/widgets/pve_qemu_power_settings_widget.dart | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > applied series, thanks!