public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH series/flutter 0/4] fixes related to PVE 7
@ 2021-06-23 10:04 Aaron Lauterer
  2021-06-23 10:04 ` [pve-devel] [PATCH dart_api_client 1/4] Add string serializer to handle int and double values Aaron Lauterer
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Aaron Lauterer @ 2021-06-23 10:04 UTC (permalink / raw)
  To: pve-devel

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-23 11:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23 10:04 [pve-devel] [PATCH series/flutter 0/4] fixes related to PVE 7 Aaron Lauterer
2021-06-23 10:04 ` [pve-devel] [PATCH dart_api_client 1/4] Add string serializer to handle int and double values Aaron Lauterer
2021-06-23 10:04 ` [pve-devel] [PATCH dart_api_client 2/4] Add int serializer to handle string values Aaron Lauterer
2021-06-23 10:04 ` [pve-devel] [PATCH dart_api_client 3/4] Add double serializer to handle String and int values Aaron Lauterer
2021-06-23 10:04 ` [pve-devel] [PATCH flutter_frontend 4/4] power settings: fix handling null for template status Aaron Lauterer
2021-06-23 11:36 ` [pve-devel] applied-series: [PATCH series/flutter 0/4] fixes related to PVE 7 Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal