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:
1 parent
b2ce82fe7e
commit
01bd8243da
6 files changed
+22
-21
No files matched your search
@@ -91,9 +91,12 @@ class _RepeaterLoginDialogState extends State<RepeaterLoginDialog> {
|
||||
final selection = await _connector.preparePathForContactSend(repeater);
|
||||
final loginFrame = buildSendLoginFrame(repeater.publicKey, password);
|
||||
final pathLengthValue = selection.useFlood ? -1 : selection.hopCount;
|
||||
final responseBytes = loginFrame.length > maxFrameSize
|
||||
? loginFrame.length
|
||||
: maxFrameSize;
|
||||
final timeoutMs = _connector.calculateTimeout(
|
||||
pathLength: pathLengthValue,
|
||||
messageBytes: loginFrame.length,
|
||||
messageBytes: responseBytes,
|
||||
);
|
||||
final timeoutSeconds = (timeoutMs / 1000).ceil();
|
||||
final timeout = Duration(milliseconds: timeoutMs);
|
||||
|
||||
@@ -91,9 +91,12 @@ class _RoomLoginDialogState extends State<RoomLoginDialog> {
|
||||
final selection = await _connector.preparePathForContactSend(room);
|
||||
final loginFrame = buildSendLoginFrame(room.publicKey, password);
|
||||
final pathLengthValue = selection.useFlood ? -1 : selection.hopCount;
|
||||
final responseBytes = loginFrame.length > maxFrameSize
|
||||
? loginFrame.length
|
||||
: maxFrameSize;
|
||||
final timeoutMs = _connector.calculateTimeout(
|
||||
pathLength: pathLengthValue,
|
||||
messageBytes: loginFrame.length,
|
||||
messageBytes: responseBytes,
|
||||
);
|
||||
final timeoutSeconds = (timeoutMs / 1000).ceil();
|
||||
final timeout = Duration(milliseconds: timeoutMs);
|
||||
|
||||
Reference in new issue
Block a user