mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-11 16:30:28 +00:00
feat: Enhance device configuration and location tracking features
- Refetch device info after updating settings in device_config_screen.dart. - Update map_tab.dart to use singleton instance of LocationTrackingService and streamline location tracking callbacks. - Modify ble_response_handler.dart to handle contact not found errors and improve error callback structure. - Enhance location_tracking_service.dart with retry logic for GPS position acquisition and initial position setting without broadcasting. - Update meshcore_ble_service.dart to track last contact for auto-recovery on errors. - Improve tile_cache_service.dart error messages and streamline tile download logic. - Add current GPS location insertion feature in direct_message_sheet.dart with permission checks. - Update pubspec.lock and pubspec.yaml to include integration_test dependency. - Add screenshot automation script for iOS and Android devices. - Create integration test driver for screenshot capturing.
This commit is contained in:
@@ -64,6 +64,11 @@ class Message {
|
||||
final DateTime? deliveredAt; // When delivery was confirmed
|
||||
final Uint8List? recipientPublicKey; // Full 32-byte public key of recipient (for retry)
|
||||
|
||||
// Retry tracking (for automatic retry with progressive timeouts)
|
||||
final int retryAttempt; // Current retry attempt (0-3), 0 = first send
|
||||
final DateTime? lastRetryAt; // When last retry was sent
|
||||
final bool usedFloodFallback; // Whether message fell back to flood mode after retries
|
||||
|
||||
// Read status tracking
|
||||
final bool isRead; // Whether message has been read by user
|
||||
|
||||
@@ -88,6 +93,9 @@ class Message {
|
||||
this.roundTripTimeMs,
|
||||
this.deliveredAt,
|
||||
this.recipientPublicKey,
|
||||
this.retryAttempt = 0,
|
||||
this.lastRetryAt,
|
||||
this.usedFloodFallback = false,
|
||||
this.isRead = false,
|
||||
});
|
||||
|
||||
@@ -172,16 +180,38 @@ class Message {
|
||||
String get deliveryStatusText {
|
||||
switch (deliveryStatus) {
|
||||
case MessageDeliveryStatus.sending:
|
||||
if (retryAttempt > 0) {
|
||||
return 'Retrying ($retryAttempt/3)...';
|
||||
}
|
||||
return 'Sending...';
|
||||
|
||||
case MessageDeliveryStatus.sent:
|
||||
if (retryAttempt > 0) {
|
||||
return 'Sent (retry $retryAttempt)';
|
||||
}
|
||||
return 'Sent';
|
||||
|
||||
case MessageDeliveryStatus.delivered:
|
||||
if (roundTripTimeMs != null) {
|
||||
return 'Delivered (${roundTripTimeMs}ms)';
|
||||
final rttText = roundTripTimeMs != null ? '${roundTripTimeMs}ms' : '';
|
||||
if (retryAttempt > 0 && rttText.isNotEmpty) {
|
||||
return 'Delivered ($rttText) [retry $retryAttempt]';
|
||||
} else if (retryAttempt > 0) {
|
||||
return 'Delivered [retry $retryAttempt]';
|
||||
} else if (rttText.isNotEmpty) {
|
||||
return 'Delivered ($rttText)';
|
||||
}
|
||||
return 'Delivered';
|
||||
|
||||
case MessageDeliveryStatus.failed:
|
||||
if (usedFloodFallback) {
|
||||
return 'Failed (tried flood)';
|
||||
}
|
||||
if (retryAttempt > 0) {
|
||||
final retryWord = retryAttempt == 1 ? 'retry' : 'retries';
|
||||
return 'Failed (after $retryAttempt $retryWord)';
|
||||
}
|
||||
return 'Failed';
|
||||
|
||||
case MessageDeliveryStatus.received:
|
||||
return '';
|
||||
}
|
||||
@@ -229,6 +259,9 @@ class Message {
|
||||
int? roundTripTimeMs,
|
||||
DateTime? deliveredAt,
|
||||
Uint8List? recipientPublicKey,
|
||||
int? retryAttempt,
|
||||
DateTime? lastRetryAt,
|
||||
bool? usedFloodFallback,
|
||||
bool? isRead,
|
||||
}) {
|
||||
return Message(
|
||||
@@ -252,6 +285,9 @@ class Message {
|
||||
roundTripTimeMs: roundTripTimeMs ?? this.roundTripTimeMs,
|
||||
deliveredAt: deliveredAt ?? this.deliveredAt,
|
||||
recipientPublicKey: recipientPublicKey ?? this.recipientPublicKey,
|
||||
retryAttempt: retryAttempt ?? this.retryAttempt,
|
||||
lastRetryAt: lastRetryAt ?? this.lastRetryAt,
|
||||
usedFloodFallback: usedFloodFallback ?? this.usedFloodFallback,
|
||||
isRead: isRead ?? this.isRead,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user