status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.85k stars 984 forks source link

Cannot open the app on the Android device after long background with enabled push notifications #20262

Open qoqobolo opened 1 month ago

qoqobolo commented 1 month ago

Bug Report

Problem

When I opened the app on the Pixel for the first tome today I faced endless login - I got stuck in the login state after biometric step. I waited a couple of minutes and re-opened the app, and now I can’t even get to the screen with a list of users - immediately after the splash screen an endless spinner appears.

I have yesterday's build https://ci.infra.status.im/job/status-mobile/job/release/job/release%252F2.29.x/9/ (yesterday it worked fine)

There are several users in the app, but the one where the endless login happened was a user with several communities, several contacts, 1-1 chats, and 1 group. I also sent a join request to the Status community from this user.

https://github.com/status-im/status-mobile/assets/67952253/bd43467d-a240-4703-a11a-bfca0f8e5f58

Expected behavior

Can open the app

Actual behavior

Can't open the app

Logs

I only have logs from the endless opening state endless_login_pixel.log.zip

Additional Information

flexsurfer commented 1 month ago
05-30 10:04:44.832  5205  5338 E ReactNativeJS: 2024-05-30T08:04:44.832Z ERROR [legacy.status-im.mailserver.core:145] - failed retrieve historical messages JSON-RPC client is unavailable

this looks suspicious

cammellos commented 1 month ago
05-30 10:04:44.832  5205  5338 E ReactNativeJS: 2024-05-30T08:04:44.832Z ERROR [legacy.status-im.mailserver.core:145] - failed retrieve historical messages JSON-RPC client is unavailable

this looks suspicious

yes, it looks like the node hasn't been started initialized correctly

qoqobolo commented 1 month ago

Closing the issue because we haven’t been able to replicate it on the latest builds after trying on several devices

fryorcraken commented 2 weeks ago

@qoqobolo to reproduce the issue that I described in mobile channel I'd recommend to do the following.

  1. Start mobile app
  2. bombard mobile app user with 1:1 messages so that a notif is received before background notif is setup

Logs https://drive.proton.me/urls/B5T22FHZ5C#kEL0uq5wthCs

qoqobolo commented 2 weeks ago

Hi @fryorcraken, thanks for the steps! I'm not sure I understand what you mean by "a notif is received before background notif is setup" though. User can't receive any push notifications on Android if the background notification service is not enabled. I mean this one in device settings:

Screenshot 2024-06-21 at 11 15 14

Maybe by "message notif" you mean these unread indicators?

Screenshot 2024-06-21 at 11 16 34

Can you share the exact and more detailed steps of what you did to reproduce this crash so we can try to reproduce it on our devices, please? When you received messages, at what point you enabled the background service, if the app was in the background - for how long, etc. Thanks in advance 🙏

fryorcraken commented 2 weeks ago

What I am saying is that an Android notification for an incoming message appeared before the background notification (circled in red below) and then it crashed.

There is a few seconds delay between login in (used biometrics) and the background notifications to appear. During this delay, it seemed I received a message.

I had the app in the foreground which may explain why I could get a message notification despite the background notification not being here yet? 🤔

I'll try to reproduce next week.

markup_1000005257.png

qoqobolo commented 2 weeks ago

There is a few seconds delay between login in (used biometrics) and the background notifications to appear. During this delay, it seemed I received a message. I had the app in the foreground which may explain why I could get a message notification despite the background notification not being here yet? 🤔

aha okay, this is an interesting detail but I'm still wondering how you got this app state.

The thing is that normally if you have the background service enabled, a logout from the app does not happen while the app in the foreground/background (only after a very long time), and you don't need to log in with a password/biometrics when you open it next time.

So if you had to log in using biometrics, that means that the app was logged out for some reason. It happens in several cases with the background service enabled:

  1. You log out manually from your profile using the Log out button (but then biometrics will be disabled)
  2. You were in the background for several hours
  3. The app crashed one more time at some point before
  4. You pressed the Stop button on the background service banner Screenshot 2024-06-21 at 12 33 07

I'll try to reproduce next week.

Thank you! It will be really helpful, because I tried the different options I mentioned above but failed to reproduce it. I’m also trying this on a new user with only one contact and chat, perhaps an amount of data and chats on your user matters.

churik commented 2 weeks ago

Reopening this one as the discussion is still ongoing and closing https://github.com/status-im/status-mobile/issues/17243 as likely duplicate