realm/RChat

slow loading times when accessing bigger chats

Closed this issue · 1 comments

After playing around with the snapshot linked in the older version of the article and the newest version we noticed that the performance with "bigger" chats (already starting at about 20 messages) is a lot worse with the current version. When clicking on a chat to open the view freezes. The more messages, the longer until it then slides to the actual conversation view (already a few full seconds for more than 20 messages). There are also other things where the app laggs for some time, such as when adding people to chats or just navigating the app. Looking at the console output, that mostly occurs when there is a Disconnection and Reconnection for no apparent reason:

2022-02-27 18:23:00.413438+0100 RChat[10194:2895762] Sync: Connection[3]: Disconnected
2022-02-27 18:23:01.012754+0100 RChat[10194:2895762] Sync: Connection[4]: Session[4]: client_reset_config = false, Realm exists = true, client reset = false
2022-02-27 18:23:01.039700+0100 RChat[10194:2895762] Sync: Connected to endpoint 'xxxxx:443' (from 'xxxxx:49665')

With the linked commit the loading time was almost instant.

Could this be due to the new way of passing the .environment(...)?

.environment(\.realmConfiguration, app.currentUser!.configuration(partitionValue: "all-users=all-the-users"))

Thanks for Your help!

Update: After finding a post of someone experiencing a similar issue I rolled back from 10.21.1 to 10.21.0 which completely fixed the issue. Loading times in this version are almost instantaneous.