-
Notifications
You must be signed in to change notification settings - Fork 18
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
LibXMTP Client Creation #156
Conversation
library/src/main/java/org/xmtp/android/library/Conversations.kt
Outdated
Show resolved
Hide resolved
suspend fun sign(message: String): SignatureOuterClass.Signature? | ||
suspend fun signLegacy(message: String): SignatureOuterClass.Signature? | ||
|
||
override fun sign(text: String): ByteArray |
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.
Java doesn't allow name shadowing since they both take a String even if they have different return values. To make this change smaller I just renamed the existing sign to signLegacy
for now but hopefully we can remove it entirely.
My group continued branch is here: #160 |
I think this is getting really close and ready for another round of review. |
library/src/main/java/org/xmtp/android/library/libxmtp/XMTPLogger.kt
Outdated
Show resolved
Hide resolved
@@ -23,7 +23,7 @@ android { | |||
compileSdk 33 | |||
|
|||
defaultConfig { | |||
minSdk 22 | |||
minSdk 23 |
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.
Bumping to 23 should be safe as all our integrators are now on it.
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.
Well done on the quick turnaround!
@@ -150,21 +170,61 @@ class Client() { | |||
val clientOptions = options ?: ClientOptions() | |||
val apiClient = | |||
GRPCApiClient(environment = clientOptions.api.env, secure = clientOptions.api.isSecure) | |||
return Client(address = address, privateKeyBundleV1 = bundle, apiClient = apiClient) | |||
val v3Client: FfiXmtpClient? = runBlocking { |
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.
So I'm a little unsure about the use of runBlocking
here and in the new sign
method. ffiXmtpClient()
may or may not do a network round-trip, and sign()
might require user interaction. I'm not an Android expert though, this is all I was able to find
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.
Changing all these create methods to suspend would be a breaking change. I'm totally down with doing it if things seem broken but lets hold off till this is out of alpha.
v3Client?.registerIdentity(null) | ||
} else { | ||
v3Client.textToSign()?.let { | ||
v3Client.registerIdentity(account?.sign(it)) |
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.
I think the account
param of this function should be non-optional - if there is a text to be signed then we must request it, or the v3 client will be non-functional
BREAKING CHANGES introduced in this PR for future release notes.
If you want to try out alpha groups
|
Part of #157
This adds the creation of a V3 client on create of any client. Makes Signing Key extend the FfiInboxOwner so that we can correctly extend and sign. Moved all the group logic to a new branch so that we can land these PRs slowly.