Repository navigation
Sign read receipts: add prepare_mark_conversation_read - #49
Open
santiagomed wants to merge 6 commits into
Open
santiagomed wants to merge 6 commits into
santiagomed wants to merge 6 commits into
Conversation
|
|
The SDK verified MarkConversationReadEvent signatures but had no way to produce one, so callers could not sign a read receipt. prepare_mark_conversation_read builds the encoded MarkConversationReadEvent detail (the read point and its time) and signs the payload the verifier already reconstructs, returning an ActionSignature. The read time defaults to the current time; the sender and signing key version resolve from the session identity, and a one-to-one id is signed in canonical colon form.
Python, JS/WASM, Go, .NET and JVM gain the method plus a MarkConversationReadParams type that follows each binding's optional-field style. The WASM wrapper takes an omitted seenAtMsec from the JavaScript clock, since wasm32 has no system clock. The Go header and the .NET P/Invoke layer are regenerated, and every binding suite covers the signed payload, the session-identity and current-time defaults, and the empty-field error.
Add prepare_mark_conversation_read to the per-binding API tables, describe read receipts next to message deletes, and record the signed MarkConversationReadEvent payload in CRYPTO.md.
santiagomed
force-pushed
the
cursor/signed-read-receipts-1119
branch
from
October 16, 2026 23:53
1b01613 to
59c197a
Compare
santiagomed
added this pull request to stack #42
October 17, 2026 01:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The SDK verifies read receipts (a
MarkConversationReadEventdecrypts toEvent::ReadReceiptand, under the default policy, is rejected when unverified) but had no way to produce one. Callers that mark a conversation read had no means to sign the receipt, so recipients receive it unsigned.Stacked on #47.
prepare_mark_conversation_read(MarkConversationReadParams)A read receipt is a plaintext signed event, like a message delete. This builds the thrift
MarkConversationReadEvent(seen_until_sequence_id+seen_at_millis), signsand returns an
ActionSignaturecarrying the encoded event detail. That is the payload the existingMarkConversationReadEventarm of the verifier reconstructs, so the receipt round-trips throughdecrypt_eventas a verifiedReadReceipt.seen_at_msecis optional and defaults to the current time. The WASM wrapper fills an omittedseenAtMsecfromDate.now(), so the core never reads the system clock onwasm32-unknown-unknown.sender_id/signing_key_versionresolve from the session identity (set_identity) when unset, as for every other producer, so the receipt carries the registered signing key version.conversation_idorseen_until_sequence_idfails with an error naming the field.Binding parity
Per AGENTS.md §2, every surface moves together:
ChatCore::prepare_mark_conversation_read/Chat::prepare_mark_conversation_read,MarkConversationReadParamsprepareMarkConversationRead+MarkConversationReadParamsinindex.d.tsprepare_mark_conversation_read(MarkConversationReadParams), withMarkConversationReadParams(conversation_id, seen_until_sequence_id, *, seen_at_msec=None, sender_id=None, signing_key_version=None)as a params class like the other Python params calls, +.pyistubPrepareMarkConversationRead,SeenAtMsec *int64withomitemptyPrepareMarkConversationRead,long? SeenAtMsecprepareMarkConversationRead,Long seenAtMsecomitted when nullThe Go header (
go/chatxdk/include/chat_xdk.h) and .NETNativeMethods.g.csare regenerated.docs/API.mdgains row 32 (later rows renumbered) and a "Read receipts are signed, not encrypted" paragraph;docs/CRYPTO.mdrecords the signed payload;CHANGELOG.mdgains an Added entry.Testing
MessageEvent→decrypt_eventround trip asserting a verifiedReadReceiptwith the read point and time, the current-time default, and empty-field rejection.verify, the session-identity and current-time defaults, and the invalid-input error.-D warnings, cargo-deny, workspace tests, WASM build, Python, JS (Node 20 and 18), JVM, .NET, Go, and the example suites.Notes
ActionSignaturefor recipients to see a signed receipt.go/chatxdk/libs/) are not regenerated here; the prebuilt sync workflow rebuilds them on push.