mirror of
https://github.com/block/buzz.git
synced 2026-11-01 06:51:17 +00:00
Tapping a mobile channel message with no replies currently opens an empty thread. Only enable message-row thread navigation when the existing thread summary reports replies, including replies known to the relay but not loaded locally. Long-press → Reply still starts a new thread. Added widget tests for zero replies, loaded replies, relay-only replies, and starting a thread through Reply. The zero-reply test failed before the fix and passes afterward. Validation: all 227 channel-page tests, the full mobile pre-push checks, and all PR CI checks passed. The full repository gate failed in unchanged Rust ACP timing tests (idle reset, keepalive, and steering deadlines); this PR changes only mobile Dart files. No duplicate open PR or issue found. --------- Signed-off-by: Tom Brow <tomb@block.xyz>
31 lines
880 B
Dart
31 lines
880 B
Dart
import 'package:buzz/features/channels/thread_reply_ownership.dart';
|
|
import 'package:buzz/shared/relay/relay.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
test(
|
|
'identity evidence is bounded while keeping recent evicted-payload owners',
|
|
() {
|
|
final owners = ThreadReplyOwnership();
|
|
owners.record([
|
|
for (var i = 0; i < 8193; i++)
|
|
NostrEvent(
|
|
id: 'reply-$i',
|
|
pubkey: 'author',
|
|
createdAt: i,
|
|
kind: EventKind.streamMessage,
|
|
tags: const [
|
|
['h', 'channel'],
|
|
['e', 'root', '', 'reply'],
|
|
],
|
|
content: '',
|
|
sig: '',
|
|
),
|
|
]);
|
|
expect(owners.rootFor('reply-0'), isNull);
|
|
expect(owners.rootFor('reply-1'), 'root');
|
|
expect(owners.rootFor('reply-8192'), 'root');
|
|
},
|
|
);
|
|
}
|