-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PlaintextEnvelope #150
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data stored in the DB: content and idempotency_key stored separately
Do you mean the libxmtp DB here? Could we just use the key to derive and store the message_id, and then throw the key away?
Generally I don't think the idempotency key should ever make its way over the FFI boundary to integrators. WDYT about that?
That makes a lot of sense!
There's 7k lines removed here - do you need to add the code-genned stuff back? |
I'd be fine with that. Just need to make sure it works for all retry scenarios (I think it should). I'll leave that up to @tuddman |
Maybe |
Something must have gone haywire in the go generator. Re-ran it and it added the code back |
@richardhuaaa I don't mind |
👍 That's the clearest by my reading in describing what this is. |
🎉 This PR is included in version 3.44.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Adds a new
PlainTextEnvelope
that wraps both theEncodedContent
and theidempotency_key
fields.It's important to clearly differentiate where this envelope is used, and where we want to break things apart.
Data going over the wire to the API: A serialized
MlsEnvelope
is the result of decrypting thedata
field of a V1 GroupMessageData stored in the DB:
content
andidempotency_key
stored separatelyMessages returned to callers of
list
orstream
methods:content
is only returnedGenerally I don't think the idempotency key should ever make its way over the FFI boundary to integrators. WDYT about that?
Other names considered
Envelope
. We already have a V1Envelope
, which has unencrypted fields. Seems confusingEncryptedEnvelope
. Feels unclear whether the contents are encrypted or whether this message is meant to be encryptedInnerEnvelope
. I don't hate this, although it's probably more accurate to say that it's in the middle.EncodedContent
lives inside of it.Issue
xmtp/libxmtp#529