Skip to content

Commit e707134

Browse files
committed
Respect discovery bounds and update typing fixtures for main
Signed-off-by: kenny lopez <[email protected]>
1 parent 0325651 commit e707134

3 files changed

Lines changed: 20 additions & 14 deletions

File tree

‎mobile/lib/shared/me/me_assistants.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final meAssistantsProvider = FutureProvider<List<AgentDirectoryEntry>>((
1717
final sync = ref.watch(meSyncProvider);
1818
final session = ref.watch(relaySessionProvider.notifier);
1919
return _loadAssistants(sync, session);
20-
});
20+
}, retry: (_, _) => null);
2121

2222
/// Freshness-controlled ownership check for one personal-chat recipient.
2323
final meAssistantOwnershipProvider = FutureProvider.family<bool, String>((

‎mobile/test/features/channels/channel_detail_page_test.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10239,7 +10239,7 @@ void main() {
1023910239
) async {
1024010240
final now = DateTime.now().millisecondsSinceEpoch ~/ 1000;
1024110241
final prompt = _textMsg(
10242-
id: 'prompt',
10242+
id: threadIdRoot,
1024310243
pubkey: 'self',
1024410244
content: 'Hello',
1024510245
createdAt: now - 3,
@@ -10259,7 +10259,7 @@ void main() {
1025910259
typing.setEntries([
1026010260
TypingEntry(
1026110261
pubkey: 'alice',
10262-
threadHeadId: 'prompt',
10262+
threadHeadId: threadIdRoot,
1026310263
expiresAtMs: (now - 1) * 1000 + 8000,
1026410264
),
1026510265
]);
@@ -10280,7 +10280,7 @@ void main() {
1028010280
content: 'Here is the reply',
1028110281
createdAt: now,
1028210282
extraTags: [
10283-
['e', 'prompt', '', 'reply'],
10283+
['e', threadIdRoot, '', 'reply'],
1028410284
],
1028510285
),
1028610286
]);

‎mobile/test/features/channels/channel_typing_provider_test.dart‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:buzz/features/channels/channel_typing_provider.dart';
22
import 'package:buzz/shared/relay/relay.dart';
33
import 'package:flutter_test/flutter_test.dart';
44
import 'package:hooks_riverpod/hooks_riverpod.dart';
5+
import '../../helpers/thread_ids.dart';
56

67
class _Relay extends RelaySessionNotifier {
78
late void Function(NostrEvent) receive;
@@ -43,28 +44,33 @@ void main() {
4344
tags: [
4445
['h', 'chat'],
4546
['e', root, '', 'root'],
46-
['e', 'parent', '', 'reply'],
47+
['e', threadIdParent, '', 'reply'],
4748
],
4849
),
4950
);
50-
emit(20002, 'a', 'root', now - 2);
51-
emit(20002, 'a', 'other', now - 2);
52-
emit(20002, 'b', 'root', now - 2);
51+
emit(20002, 'a', threadIdRoot, now - 2);
52+
emit(20002, 'a', threadIdOtherRoot, now - 2);
53+
emit(20002, 'b', threadIdRoot, now - 2);
5354
expect(container.read(provider), hasLength(3));
54-
emit(9, 'a', 'root', now - 1);
55+
emit(9, 'a', threadIdRoot, now - 1);
5556
expect(container.read(provider).map((e) => (e.pubkey, e.threadHeadId)), [
56-
('a', 'other'),
57-
('b', 'root'),
57+
('a', threadIdOtherRoot),
58+
('b', threadIdRoot),
5859
]);
5960
emit(
6061
20002,
6162
'a',
62-
'root',
63+
threadIdRoot,
6364
now,
6465
); // Newer but inside desktop's quiet interval.
65-
emit(20002, 'a', 'root', now - 2); // Delayed old pulse.
66+
emit(20002, 'a', threadIdRoot, now - 2); // Delayed old pulse.
6667
expect(container.read(provider), hasLength(2));
67-
emit(20002, 'c', 'root', now - 9); // Expired history is not live typing.
68+
emit(
69+
20002,
70+
'c',
71+
threadIdRoot,
72+
now - 9,
73+
); // Expired history is not live typing.
6874
expect(container.read(provider), hasLength(2));
6975
},
7076
);

0 commit comments

Comments
 (0)