mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-11 08:20:36 +00:00
Fix channel message dedup logic
This commit is contained in:
@@ -647,9 +647,8 @@ class MessagesProvider with ChangeNotifier {
|
||||
return false;
|
||||
}
|
||||
|
||||
final timestampDeltaSeconds = (existing.senderTimestamp -
|
||||
message.senderTimestamp)
|
||||
.abs();
|
||||
final timestampDeltaSeconds =
|
||||
(existing.senderTimestamp - message.senderTimestamp).abs();
|
||||
final withinChannelRepeatWindow = timestampDeltaSeconds <= 5;
|
||||
|
||||
final existingSenderKey = existing.senderKeyShort;
|
||||
|
||||
@@ -176,9 +176,7 @@ void main() {
|
||||
);
|
||||
});
|
||||
|
||||
test(
|
||||
'channel replay is deduped for self sender within repeat window',
|
||||
() {
|
||||
test('channel replay is deduped for self sender within repeat window', () {
|
||||
final provider = MessagesProvider();
|
||||
provider.resolveContactNameCallback = (_) => 'dz0ny (SI)';
|
||||
provider.addSentMessage(
|
||||
@@ -197,8 +195,7 @@ void main() {
|
||||
expect(provider.messages, hasLength(1));
|
||||
expect(provider.messages.single.id, equals('c-echo'));
|
||||
expect(provider.messages.single.senderName, equals('dz0ny (SI)'));
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
test(
|
||||
'channel replay is not deduped for different sender with same text',
|
||||
|
||||
Reference in New Issue
Block a user