Skip to content
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

Increase network timeouts and retries #226

Merged
merged 2 commits into from
Apr 15, 2024
Merged

Conversation

nplasterer
Copy link
Contributor

@nplasterer nplasterer commented Apr 13, 2024

Closes #223

I'm seeing the tests pass now even on poor connection.

@nplasterer nplasterer self-assigned this Apr 13, 2024
@nplasterer nplasterer changed the title WIP Increase network timeouts Increase network timeouts and retries Apr 15, 2024
@nplasterer nplasterer marked this pull request as ready for review April 15, 2024 23:15
@nplasterer nplasterer requested a review from a team as a code owner April 15, 2024 23:15
dbPath = dbPath,
installationId = v3Client?.installationId()?.toHex() ?: ""
)
return buildFromV1Bundle(bundle, options, account)
Copy link
Contributor Author

@nplasterer nplasterer Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was duplicate code inside of buildFromV1Bundle so instead of trying to keep to copies of the code just call into the other one.

val address = v1Bundle.identityKey.publicKey.recoverWalletSignerPublicKey().walletAddress
val newOptions = options ?: ClientOptions()
val apiClient =
GRPCApiClient(
environment = newOptions.api.env,
secure = newOptions.api.isSecure,
)
val (v3Client, dbPath) = if (isAlphaMlsEnabled(options)) {
runBlocking {
ffiXmtpClient(
options,
account,
options?.appContext,
v1Bundle,
LegacyIdentitySource.STATIC,
address
)
}
} else Pair(null, "")
return Client(
address = address,
privateKeyBundleV1 = v1Bundle,
apiClient = apiClient,
libXMTPClient = v3Client,
dbPath = dbPath,
installationId = v3Client?.installationId()?.toHex() ?: ""
)

@nplasterer nplasterer merged commit f0f702f into main Apr 15, 2024
5 of 6 checks passed
@nplasterer nplasterer deleted the np/try-increase-timeouts branch April 15, 2024 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: GRPC sometimes errors
3 participants