diff --git a/assets/changelog.json b/assets/changelog.json index 93931de..3ecee10 100644 --- a/assets/changelog.json +++ b/assets/changelog.json @@ -1,4 +1,10 @@ { + "1.6.1": { + "content": [ + "• IMPROVED: Navigation route calculation timeout increased from 15 to 30 seconds - better success rate for complex routes in dense areas", + "• TECHNICAL: Route timeout is now configurable in dev_config for easier future adjustments" + ] + }, "1.6.0": { "content": [ "• Internal code organization improvements - better separation of concerns for improved maintainability", diff --git a/lib/dev_config.dart b/lib/dev_config.dart index e0b4b9f..2bb83b9 100644 --- a/lib/dev_config.dart +++ b/lib/dev_config.dart @@ -60,6 +60,9 @@ const Duration kChangesetCloseMaxRetryDelay = Duration(minutes: 5); // Cap at 5 const Duration kChangesetAutoCloseTimeout = Duration(minutes: 59); // Give up and trust OSM auto-close const double kChangesetCloseBackoffMultiplier = 2.0; +// Navigation routing configuration +const Duration kNavigationRoutingTimeout = Duration(seconds: 30); // HTTP timeout for routing requests + // Suspected locations CSV URL const String kSuspectedLocationsCsvUrl = 'https://alprwatch.org/suspected-locations/deflock-latest.csv'; diff --git a/lib/services/routing_service.dart b/lib/services/routing_service.dart index 781936d..94b43bc 100644 --- a/lib/services/routing_service.dart +++ b/lib/services/routing_service.dart @@ -5,6 +5,7 @@ import 'package:latlong2/latlong.dart'; import 'package:shared_preferences/shared_preferences.dart'; import '../app_state.dart'; +import '../dev_config.dart'; class RouteResult { final List waypoints; @@ -26,7 +27,6 @@ class RouteResult { class RoutingService { static const String _baseUrl = 'https://alprwatch.org/api/v1/deflock/directions'; static const String _userAgent = 'DeFlock/1.0 (OSM surveillance mapping app)'; - static const Duration _timeout = Duration(seconds: 15); // Calculate route between two points using alprwatch Future calculateRoute({ @@ -72,7 +72,7 @@ class RoutingService { 'Content-Type': 'application/json' }, body: json.encode(params) - ).timeout(_timeout); + ).timeout(kNavigationRoutingTimeout); if (response.statusCode != 200) { throw RoutingException('HTTP ${response.statusCode}: ${response.reasonPhrase}'); diff --git a/pubspec.yaml b/pubspec.yaml index 46b266c..60ed547 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: deflockapp description: Map public surveillance infrastructure with OpenStreetMap publish_to: "none" -version: 1.6.0+26 # The thing after the + is the version code, incremented with each release +version: 1.6.1+27 # The thing after the + is the version code, incremented with each release environment: sdk: ">=3.5.0 <4.0.0" # oauth2_client 4.x needs Dart 3.5+