ephemeraHQ / converse-app

https://converse.xyz
MIT License
38 stars 3 forks source link

App Crash - Android #326

Closed alexrisch closed 1 week ago

alexrisch commented 1 month ago

App crashed during testing 2 times, when I reopened, after the first time, the names shows as 0x instead of user name. Other than group chat - group chat remained with set name.

nmalzieu commented 1 month ago

Here is a list of crashes on Android:

https://converse-app.sentry.io/issues/5619722109/events/cf604065104b417a6ca77436e2d699cf/?project=4504757120729088 https://converse-app.sentry.io/issues/4912444214/?environment=prod&project=4504757120729088&query=is:unresolved+os.name:Android&statsPeriod=24h&stream_index=1 https://converse-app.sentry.io/issues/5595661243/?environment=prod&project=4504757120729088&query=is:unresolved+os.name:Android&statsPeriod=24h&stream_index=12 https://converse-app.sentry.io/issues/5655074139/?environment=prod&project=4504757120729088&query=is:unresolved+os.name:Android&statsPeriod=24h&stream_index=16

@nplasterer @insipx @cameronvoell any of those ring a bell? You can check the logs ("Breadcrumbs") by scrolling a bit, there sometimes are libxmtp errors

nplasterer commented 1 month ago

Okay just going through this list and going to add color to each of the issues I see

UNIQUE constraint failed: group_messages.id

https://converse-app.sentry.io/issues/5619722109/events/cf604065104b417a6ca77436e2d699cf/?project=4504757120729088 [libxmtp] receive error ReceiveErrors([OpenMlsProcessMessage(ValidationError(WrongEpoch)), Storage(DieselResult(DatabaseError(UniqueViolation, "UNIQUE constraint failed: group_messages.id"))), Storage(DieselResult(DatabaseError(UniqueViolation, "UNIQUE constraint failed: group_messages.id")))])

Maybe @insipx can speak to this one. This hopefully shouldn't be crashing the app if the group message was already written than it should just silently error and not break everything.

Expected URL scheme 'http' or 'https' but was 'eip155'

https://converse-app.sentry.io/issues/4912444214/?environment=prod&project=4504757120729088&query=is%3Aunresolved+os.name%3AAndroid&statsPeriod=24h&stream_index=1 java.lang.IllegalArgumentException(Expected URL scheme 'http' or 'https' but was 'eip155')

This looks like a java error. Are you certain this is being thrown from our code? Can you give me more details on where and what is triggering this?

API client error: identity error: status: ResourceExhausted

https://converse-app.sentry.io/issues/5595661243/?environment=prod&project=4504757120729088&query=is%3Aunresolved+os.name%3AAndroid&statsPeriod=24h&stream_index=12 Error: Call to function 'XMTP.createFromKeyBundle' has been rejected. → Caused by: org.xmtp.android.library.XMTPException: Failed to create client: uniffi.xmtpv3.GenericException$Generic: Generic Error: API client error: identity error: status: ResourceExhausted

This looks like an identity error thats maybe also related to the database. ResourcesExhausted feels like we have too many calls going to the database. So the previous calls to the database seem to be locking the database to some extent which then makes login fail. Probably a question for @insipx again.

OpenMlsProcessMessage(ValidationError(UnableToDecrypt(AeadError)))

https://converse-app.sentry.io/issues/5655074139/?environment=prod&project=4504757120729088&query=is%3Aunresolved+os.name%3AAndroid&statsPeriod=24h&stream_index=16 [libxmtp] receive error ReceiveErrors([OpenMlsProcessMessage(ValidationError(WrongEpoch)), OpenMlsProcessMessage(ValidationError(WrongEpoch)), OpenMlsProcessMessage(ValidationError(WrongEpoch)), OpenMlsProcessMessage(ValidationError(WrongEpoch)), OpenMlsProcessMessage(ValidationError(UnableToDecrypt(AeadError))), OpenMlsProcessMessage(ValidationError(WrongEpoch)), OpenMlsProcessMessage(ValidationError(WrongEpoch)), OpenMlsProcessMessage(ValidationError(WrongEpoch)), OpenMlsProcessMessage(ValidationError(WrongEpoch)), OpenMlsProcessMessage(ValidationError(WrongEpoch)), OpenMlsProcessMessage(ValidationError(UnableToDecrypt(AeadError))), OpenMlsProcessMessage(ValidationError(UnableToDecrypt(AeadError))), OpenMlsProcessMessage(ValidationError(WrongEpoch)), OpenMlsProcessMessage(ValidationError(UnableToDecrypt(AeadError))), OpenMlsProcessMessage(ValidationError(UnableToDecrypt(AeadError))), OpenMlsProcessMessage(ValidationError(UnableToDecrypt(AeadError))), OpenMlsProcessMessage(ValidationError(UnableToDecrypt(AeadError))), OpenMlsProcessMessage(ValidationError(UnableToDecrypt(AeadError))), OpenMlsProcessMessage(ValidationError(WrongEpoch)), OpenMlsProcessMessage(ValidationError(WrongEpoch))])

I was nearly certain that we fixed this issue in the latest release. Is it possible this was someone on an older build. We shouldn't be seeing this one any more going forward.

nmalzieu commented 1 month ago

Thanks @nplasterer !

Yeah the API Client was not supposed to be there sorry. Ok let's ignore the last one for now and see if it comes back, and let's see what @insipx has to say about the other two?

insipx commented 1 month ago

I'll be looking into these today and see what I can find to come up with more context!

Just from the error messages

1.) The first one seems to happen because of inserting a group message that already exists in the db. Could be a race like with PublishIntents or a number of things happening there

2.) This ones interesting eip155 is an Ethereum Improvement Proposal concerning ChainIds. It lets us know which endpoint to query based on a chain identifier. So something is happening where were trying to reach an https url but instead using a url with eip155 presumably to specify the chainid. There's a wrong URL somewhere but also will look into this today to figure out what's triggering it

With smart contract support, I think we query an RPC url to verify signatures for smart contract wallets. This can probably happen if that provider URL format changes for some reason or is incorrect

3.) This ones definitely a gRPC Error and can actually be because of too many API Calls to the backend. I'll look into quota limits here, not too familiar with how gRPC handles these things but maybe we're just hitting the API too much with certain calls

nmalzieu commented 1 week ago

I think we can close this task and open specific ones for Sentry crashes we see in the future.