Skip to content

Commit 8ae22e7

Browse files
committed
trying again
1 parent d8cdd4f commit 8ae22e7

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

docs/pages/protocol/cursors.mdx

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,27 @@ Each `sync()` function corresponds to a different type of cursor:
4646
For example, here is a sequence diagram illustrating how cursors operate with `conversation.sync()`:
4747

4848
<div className="diagram-white-bg">
49-
<Mermaid
50-
id="cursors"
51-
chart={`
52-
sequenceDiagram
53-
participant Client as Client <br> (Stores cursor)
54-
participant Network as Network <br> (Stores group topic)
55-
56-
Note over Client: No cursor for topic yet
57-
Client ->> Network: Initial conversation.sync()
58-
Network ->> Client: Returns all messages from topic <br> (Msg1, Msg2, Msg3)
59-
Note over Client: Stores new cursor for topic
60-
Client ->> Client: Cursor points after Msg3
61-
Note over Network: New messages arrive on group topic
62-
Network ->> Client: streamAllMessages() <br> (Msg4, Msg5, Msg6)
63-
Note over Client: Cursor unaffected by stream
64-
Client ->> Network: Subsequent conversation.sync() <br> (Sends stored cursor from after Msg3)
65-
Network ->> Client: Returns messages that occurred after cursor <br> (Msg4, Msg5, Msg6)
66-
Note over Client: Advances cursor for topic
67-
Client ->> Client: Cursor points after Msg6
68-
`}
69-
/>
70-
49+
<Mermaid
50+
id="cursors"
51+
chart={`
52+
sequenceDiagram
53+
participant Client as Client <br> (Stores cursor)
54+
participant Network as Network <br> (Stores group topic)
55+
56+
Note over Client: No cursor for topic yet
57+
Client ->> Network: Initial conversation.sync()
58+
Network ->> Client: Returns all messages from topic <br> (Msg1, Msg2, Msg3)
59+
Note over Client: Stores new cursor for topic
60+
Client ->> Client: Cursor points after Msg3
61+
Note over Network: New messages arrive on group topic
62+
Network ->> Client: streamAllMessages() <br> (Msg4, Msg5, Msg6)
63+
Note over Client: Cursor unaffected by stream
64+
Client ->> Network: Subsequent conversation.sync() <br> (Sends stored cursor from after Msg3)
65+
Network ->> Client: Returns messages that occurred after cursor <br> (Msg4, Msg5, Msg6)
66+
Note over Client: Advances cursor for topic
67+
Client ->> Client: Cursor points after Msg6
68+
`}
69+
/>
7170
</div>
7271

7372
By understanding cursors, you can better reason about the behavior of your app's synchronization logic and the data being transferred from the XMTP network.

0 commit comments

Comments
 (0)