Refactor LoRa airtime tests and add new functionality

- Updated LoRa airtime calculations in `lora_airtime_test.dart` to reflect new reference values.
- Introduced new tests for LDRO behavior and preamble symbol calculations.
- Added `contact_path_width_test.dart` to validate path hash width handling in contacts.
- Enhanced `model_changes_test.dart` to ensure legacy data migration works correctly.
- Created `remote_node_stats_test.dart` to decode and validate remote node statistics.
- Implemented `map_marker_parse_test.dart` for parsing marker text with coordinate validation.
- Developed `map_tile_cache_key_test.dart` to ensure API keys are excluded from cache keys.
- Added `message_retry_failure_test.dart` to test message retry service behavior on failures.
- Extended `path_history_service_test.dart` to preserve learned state across path attempts.
- Enhanced `received_image_store_test.dart` to handle concurrent writes and review fixes.
- Implemented `repeater_command_service_test.dart` to validate command response handling.
- Created `store_tolerant_parsing_test.dart` to ensure stores skip malformed records gracefully.
- Cleared untranslated JSON file for localization updates.
This commit is contained in:
Zach committed 2026-09-25 10:01:18 -07:00
1 parent d5f54dfa11
commit d74587c167
105 files changed
+6419 -2072

No files matched your search

+16 -4
View File
@@ -57,12 +57,22 @@ class MessageStore {
return [];
}
final List<dynamic> jsonList;
try {
final jsonList = jsonDecode(jsonString) as List<dynamic>;
return jsonList.map((json) => _messageFromJson(json)).toList();
jsonList = jsonDecode(jsonString) as List<dynamic>;
} catch (e) {
appLogger.warn('Stored messages for $contactKeyHex are unreadable: $e');
return [];
}
final messages = <Message>[];
for (final json in jsonList) {
try {
messages.add(_messageFromJson(json as Map<String, dynamic>));
} catch (e) {
appLogger.warn('Skipping malformed stored message: $e');
}
}
return messages;
}
Future<void> clearMessages(String contactKeyHex) async {
@@ -146,9 +156,11 @@ class MessageStore {
senderKey: Uint8List.fromList(base64Decode(json['senderKey'] as String)),
text: decodedText,
timestamp: DateTime.fromMillisecondsSinceEpoch(json['timestamp'] as int),
isOutgoing: json['isOutgoing'] as bool,
isOutgoing: json['isOutgoing'] as bool? ?? false,
isCli: isCli,
status: MessageStatus.values[json['status'] as int],
status:
MessageStatus.values.elementAtOrNull(json['status'] as int? ?? -1) ??
MessageStatus.failed,
messageId: json['messageId'] as String?,
originalText: json['originalText'] as String?,
translatedText: json['translatedText'] as String?,