Rocket.Chat.ReactNative icon indicating copy to clipboard operation
Rocket.Chat.ReactNative copied to clipboard

bug: excessive cold startup time on each fresh app launch

Open matejbart opened this issue 8 months ago • 7 comments

Describe the Bug

A fresh (cold) start of the app takes an excessive amount of time to proceed. The app hangs on the splash screen for multiple seconds (best case ~8 seconds, worst case ~20 seconds).

Steps to Reproduce

  1. Ensure that the app is not running in the background. (Either kill it from the task manager or force stop via app's settings).
  2. Start the app.

Expected Behavior

The app should not hang for multiple seconds on the splash screen after a fresh start.

Actual Behavior

The app hangs for multiple seconds on the splash screen (after a fresh start).

Rocket.Chat Server Version

(not related to any server)

Rocket.Chat App Version

4.59.0

Device Name

Pixel 6

OS Version

Android 15

Additional Context

The issue already happens after a fresh install without even being logged into a server.

I attached two log files, in both cases the app hangs on the following log line: <MMKV.cpp:207::initializeMMKV> root dir: /data/user/0/chat.rocket.android/files/mmkv. The app stops hanging after the line which happens in the best case after 8 seconds, but sometimes it takes even 20 seconds to proceed: <MemoryFile.cpp:97::open> open fd[0xb9], /data/user/0/chat.rocket.android/files/mmkv/default

rocketchat_startup_8seconds.log rocketchat_startup_20seconds.log


I observed the same behavior on other device models and android versions as well, such as:

  • Samsung Galaxy A16 5G, Android 14
  • Pixel 6a, Android 15

However, the following devices aren't affected by the very long startup time:

matejbart avatar Apr 18 '25 13:04 matejbart

We are migrating to another mmkv library and expecting it to improve the startup time.

Will remind you once https://github.com/RocketChat/Rocket.Chat.ReactNative/pull/6744 get merged :)

Rohit3523 avatar Nov 11 '25 19:11 Rohit3523

We are migrating to another mmkv library and expecting it to improve the startup time.

Will remind you once #6744 get merged :)

It merged @matejbart are you facing issue now? I checked and didn't face any delay

deepak0x avatar Dec 15 '25 20:12 deepak0x

It is merged but release is pending...

Rohit3523 avatar Dec 15 '25 20:12 Rohit3523

It is merged but release is pending...

I checked locally didn't get any delay

deepak0x avatar Dec 15 '25 20:12 deepak0x

We are migrating to another mmkv library and expecting it to improve the startup time. Will remind you once #6744 get merged :)

It merged @matejbart are you facing issue now? I checked and didn't face any delay

If you can provide a preview/test APK, I’m happy to test it for you.

matejbart avatar Dec 16 '25 07:12 matejbart

You can download the apk from https://github.com/RocketChat/Rocket.Chat.ReactNative/pull/6846#issuecomment-3657738674

Rohit3523 avatar Dec 16 '25 08:12 Rohit3523

Thx, I tested the experimental version 4.68.0.107856 with all affected android devices and there is no longer any long delay at the app's startup.

Just for documentation purposes: I also tested with the current live version 4.67.1.107769 which now only affects my two devices Pixel 6 and Pixel 6a (with the most recent Nov 2025 OS update).

matejbart avatar Dec 16 '25 13:12 matejbart

Thx, I tested the experimental version 4.68.0.107856 with all affected android devices and there is no longer any long delay at the app's startup.

Just for documentation purposes: I also tested with the current live version 4.67.1.107769 which now only affects my two devices Pixel 6 and Pixel 6a (with the most recent Nov 2025 OS update).

I too checked on pixel 6.. but on emulator. can you please share the video if possible so that I can try to reproduce and work on it further...

deepak0x avatar Dec 20 '25 11:12 deepak0x

Sure, I made a video with my Pixel 6 device for both versions:

v4.67.1.107769

https://github.com/user-attachments/assets/0ffe152e-27ee-4a28-b6a9-a74aae24846c

v4.68.0.107856

https://github.com/user-attachments/assets/370da9a2-4234-40ae-82c5-d9ee7ebe9a97

matejbart avatar Dec 20 '25 11:12 matejbart

It seems the issue is fixed but I will keep the issue open until we make 4.68.0 store release and you test the same on it :)

Rohit3523 avatar Dec 20 '25 11:12 Rohit3523