docs(xchat): correct chat-xdk SDK API surface across guides - #256
Merged
Conversation
Fix API-accuracy bugs against the current SDK: streaming is a two-arg raw-bytes call (media_hash_key comes from upload finalize, not encrypt_stream); prepare methods take a single params object/struct in every binding except Python (and the params types dropped the Prepare prefix); decrypt_events .errors is a map, not a list; Go conversation keys are raw bytes, not base64; verification is fail-closed by default. Add the incremental streaming API, the keyVersion-per-event media key selection contract, the three Juicebox config shapes, and the hex utility helpers.
Address code-review findings on the API-accuracy pass: TypeScript encrypt_message/encrypt_reply/reactions take a single params object; Go import_keys takes raw bytes (decode the base64 env var first); Go utility calls honor their (value, error) arities; Java reads the public conversationKey field, not a getter; C#/Java/Rust image-dimension and conversation-key types match the SDK; width/height casts added where narrowing.
State the conversation key as plain raw bytes without phrasing that implies a prior encoding, and remove code comments that only restate a variable's type.
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.
Rebased onto the
xchat-docsbranch (the chat API docs integration branch), not main.What
Corrects API-accuracy bugs in the X Chat SDK guides against the current chat-xdk SDK, so every language tab matches the shipped API.
Bugs fixed
encrypt_stream/decrypt_streamare two-arg raw-bytes calls (no{ciphertext, media_hash_key}return / 3-arg decrypt);media_hash_keycomes from the media-upload finalize step.Prepareprefix (PrepareGroupCreateParams→GroupCreateParams).encrypt_message/encrypt_reply/reactions: TypeScript tabs now use the params object (reply usesreplyToSequenceId).decrypt_events.errorsis a map{ index → message }, not a list.[]byte;ImportKeystakes[]byte; Go utility calls honor(value, error)arities.conversationKeyfield (no getter); C#/Java/Rust image-dimension and conversation-key types corrected (ImageDimensions,Option<XChatConversationKey>+.to_bytes(),&XChatConversationKey).Gaps added
stream_encryptor/stream_decryptor; JS "neverfree()afterfinish()").keyVersion-per-event → media key selection after a rotation.Verification
Every signature checked against the SDK source. Reviewer pass run; all valid findings applied (a "two juicebox shapes" finding was rejected — verified the third
key_store_token_map_jsonbranch is on chat-xdk main). All<Tabs>/<Tab>blocks balanced.