Audio Recordings do not load (randomly)



we have a Problem with audio recordings in the app. Randomly they just fail to load. Sometimes the last, sometimes all, sometimes a few. Restarting the app usually helps for some time until switching channels. All ~100 users have this problem. On desktop everything works fine.
Images and all other files also always work.
To me it seems that the recordings dont get cached on the phone. As they all seem to download one after another after restarting the app. Which can take some seconds for each (If they even load)
Someone have some idea what is causing this?

Server Setup Information

  • Version of Rocket.Chat Server: newest
  • Operating System: ubuntu 18.04
  • Deployment Method: snap
  • Number of Running Instances: 1
  • Proxy: caddy
  • Firewalls involved: 3001/3000 port redirection

Any additional Information


The problem happens only at Mobile?

Do the audio at the web and desktop APP version work as expected?


Yes only on mobile. But moving from caddy to nginx and then turning of keepalive seems to have fixed the issue as of right now. Maybe the worker_connections limit was just exceeded. I dont know.
Because what seems to happen is the client still downloads all files even after switching channels. So if someone opens up a chat with 50 audio files and quickly moves to another one the 50 still load in the background and all pending requests still get finished up by the server. Wouldnt it be better that a channel switch cancels those?
Now the next problem is that the ram fills up with all those audio files and eventually the App freezes. The browser crashes also. It takes about 50 channel switches so its not extremely problematic but there seems to be some kind of issue with the garbage collection.
Dont know if there is a solution or this is a general problem that needs to be reviewed.

I think the first answer is to get off snaps and use something like docker that is more configurable and you can start spreading loads when required.

Snaps were only really intended for low usage systems.

Also get all your files out of GridFS into some form of storage. There is information here if you search.

That may help server side.

I am not sure what can be done client side beyond giving your clients more resources.