Skip to content

Commit 8c12222

Browse files
committed
docs(test): correct the FakeServer initial-snapshot timing comment
start() schedules _pushInitialState() on a 150ms timer rather than emitting synchronously. The reason to subscribe before start() stands — a listener attached afterwards can miss that emission — but the stated mechanism was wrong. Review follow-up on PR #157.
1 parent c9e22e0 commit 8c12222

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/test/fake_server_demo_data_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ void main() {
8989
final server = FakeServer();
9090
addTearDown(server.stop);
9191

92-
// Subscribe BEFORE start(): the first snapshot is emitted synchronously by
93-
// start(), so a later firstWhere() would wait forever for a second one.
92+
// Subscribe BEFORE start(): start() schedules `_pushInitialState()` on a
93+
// 150ms timer, so a listener attached afterwards can miss that emission
94+
// entirely — and a firstWhere() added later would then wait for a second
95+
// snapshot that never comes.
9496
final snapshots = <List<Session>>[];
9597
final acks = <String, Envelope>{};
9698
final sub = server.outgoing.listen((e) {

0 commit comments

Comments
 (0)