Refactor timeout calculations for repeater and login frames to ensure minimum message size is respected; remove obsolete widget test file.

This commit is contained in:
zjs81
2026-01-11 17:40:19 -07:00
parent b2ce82fe7e
commit 01bd8243da
6 changed files with 22 additions and 21 deletions
+6 -5
View File
@@ -70,11 +70,6 @@ class RepeaterCommandService {
_pendingByPrefix[prefix] = commandId;
final framedCommand = '$prefix$command';
final pathLengthValue = selection.useFlood ? -1 : selection.hopCount;
final timeoutMs = _connector.calculateTimeout(
pathLength: pathLengthValue,
messageBytes: framedCommand.length,
);
final timeoutSeconds = (timeoutMs / 1000).ceil();
final timestampSeconds = DateTime.now().millisecondsSinceEpoch ~/ 1000;
_connector.trackRepeaterAck(
contact: repeater,
@@ -89,6 +84,12 @@ class RepeaterCommandService {
attempt: attempt,
timestampSeconds: timestampSeconds,
);
final responseBytes = frame.length > maxFrameSize ? frame.length : maxFrameSize;
final timeoutMs = _connector.calculateTimeout(
pathLength: pathLengthValue,
messageBytes: responseBytes,
);
final timeoutSeconds = (timeoutMs / 1000).ceil();
await _connector.sendFrame(frame);
_commandTimeouts[commandId]?.cancel();
_commandTimeouts[commandId] = Timer(