From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <a.lauterer@proxmox.com>
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 1910174FAE
 for <pve-devel@lists.proxmox.com>; Wed, 23 Jun 2021 12:04:48 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 0D0D9940E
 for <pve-devel@lists.proxmox.com>; Wed, 23 Jun 2021 12:04:48 +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 EE3689132
 for <pve-devel@lists.proxmox.com>; Wed, 23 Jun 2021 12:04:45 +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 C45E446721
 for <pve-devel@lists.proxmox.com>; Wed, 23 Jun 2021 12:04:45 +0200 (CEST)
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Wed, 23 Jun 2021 12:04:40 +0200
Message-Id: <20210623100444.1440650-1-a.lauterer@proxmox.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.520 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] [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 <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Wed, 23 Jun 2021 10:04:48 -0000

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(-)


-- 
2.30.2