From f9e90dab0686a5a01a29cb29500fb23a052bb9db Mon Sep 17 00:00:00 2001 From: zontreck Date: Sun, 25 May 2025 14:28:22 -0700 Subject: [PATCH] Resolve issue with concurrent list modification during cache save --- lib/consts.dart | 2 +- lib/data.dart | 10 ++++++++-- pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/consts.dart b/lib/consts.dart index 126e9c5..542b905 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -9,7 +9,7 @@ class TTConsts { static get SESSION_SERVER => "https://api.zontreck.com/timetrack/$UPDATE_CHANNEL/timetrack.php"; - static const VERSION = "1.0.0-beta.20"; + static const VERSION = "1.0.0-beta.21"; static bool UPDATE_AVAILABLE = false; static UpdateChannel UPDATE_CHANNEL = UpdateChannel.beta; diff --git a/lib/data.dart b/lib/data.dart index 92d4ea1..814f692 100644 --- a/lib/data.dart +++ b/lib/data.dart @@ -392,13 +392,19 @@ class SessionData { } ListTag posX = ListTag(); - for (var pos in positions) { + int len = positions.length; + int i = 0; + for (i = 0; i < len; i++) { + var pos = positions[i]; posX.add(await pos.toNBT()); } ct.put("pos", posX); ListTag myTrips = ListTag(); - for (var trip in Trips) { + len = Trips.length; + i = 0; + for (i = 0; i < len; i++) { + var trip = Trips[i]; myTrips.add(await trip.toNBT()); } ct.put("trips", myTrips); diff --git a/pubspec.yaml b/pubspec.yaml index ffbe8b8..e5d9d2c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0-beta.20 +version: 1.0.0-beta.21 environment: sdk: ^3.7.2