Skip to content

Commit d7c16b1

Browse files
committed
Deep-link the migration guide and spell out the watcher test choreography
1 parent d971680 commit d7c16b1

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

docs/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ async with client.listen(resource_subscriptions=["note://todo"]) as sub:
15511551
...
15521552
```
15531553

1554-
See the [Subscriptions](handlers/subscriptions.md) page for the full client-side contract (typed events, the honored filter, clean end vs `SubscriptionLost`).
1554+
See the [Subscriptions](handlers/subscriptions.md#the-client-side) page for the full client-side contract (typed events, the honored filter, clean end vs `SubscriptionLost`).
15551555

15561556
### Roots, Sampling, and Logging methods deprecated (SEP-2577)
15571557

tests/docs_src/test_subscriptions.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,14 @@ async def test_watcher_re_listens_after_both_endings() -> None:
190190
"""tutorial004: watch() refetches on entry and per event, and re-listens after
191191
a graceful server close and after `SubscriptionLost`.
192192
193-
Runs on trio's autojumping MockClock so the loop's backoff sleep takes no wall-clock time."""
193+
Runs on trio's autojumping MockClock so the loop's backoff sleep takes no wall-clock time.
194+
195+
Steps:
196+
1. Stream 1: the entry refetch proves the ack arrived; a publish drives an event refetch.
197+
2. handler.close() ends stream 1 gracefully; the watcher backs off, re-listens (stream 2,
198+
a new subscription id), and refetches.
199+
3. The drop tool cancels stream 2 abruptly; the watcher swallows SubscriptionLost,
200+
re-listens (stream 3), and refetches on the next publish."""
194201
DROP_SCHEMA: dict[str, Any] = {
195202
"type": "object",
196203
"properties": {"subscription_id": {"type": "string"}},

0 commit comments

Comments
 (0)