Where do I set NOTIFICATIONS_SCHEDULE_DELAY for a docker install?

I’ve installed rocket.chat using docker compose. Currently I’m in the process of persuading our small business team to switch over from using Whatsapp and FB Messenger. It has taken months but I am _so_close.

Myself and my co-founder have been using it for personal chats for about two months and she is mostly convinced that’s it’s a good idea to switch the entire team.

There’s just one blocker: notifications. She was complaining that Rocket.Chat notifications are too slow and makes short conversations get spread out over hours.

We just sat down together. I sent her a message on Whatsapp, she got a notification instantly. She checked the message, locked her phone and I sent her another message. Again, received instantly. We repeated the experiment with Messenger, same result.

Finally we tested with Rocket.Chat. I sent her a notification. We waited… nothing. After about 30 seconds she opened the app and my message is there, but no notification. She locked her phone and I sent another message. Still nothing. We waited a few minutes and finally the notification did show up so notifications are working.

Also note that if I “Send a test push to my user”, I receive that instantly on the Android app.

I’ve checked around and found some discussions like this one:

And also this PR from V3.4.0 which references some NOTIFICATIONS_SCHEDULE_DELAY settings

The settings in question:

NOTIFICATIONS_SCHEDULE_DELAY_ONLINE
NOTIFICATIONS_SCHEDULE_DELAY_AWAY
NOTIFICATIONS_SCHEDULE_DELAY_OFFLINE

I cannot find any reference to these anywhere else though.

So two questions:

  1. Do these settings exist recent Rocket.Chat releases?
  2. Will changing them make mobile notifications get delivered fater? If not is there some other way?
  3. How do I change them? Can I set them as environment variables in my docker compose?
version: "3.7"

services:
  rocketchat:
    image: registry.rocket.chat/rocketchat/rocket.chat:latest
    restart: unless-stopped
    volumes:
      - /mnt/containers/rocketchat/app/uploads:/app/uploads
    labels:
      traefik.enable: 'false'
    environment:
      MONGO_URL: "mongodb://mongodb:27017/rocketchat?replicaSet=rs0"
      MONGO_OPLOG_URL: "mongodb://mongodb:27017/local?replicaSet=rs0"
      ROOT_URL: http://localhost:3021
      PORT: 3021
    depends_on:
      - mongodb   
    expose:
      - 3021
    ports:
      - 3021:3021

  mongodb:
    image: mongo:5
    restart: unless-stopped
    volumes:
      - /mnt/containers/rocketchat/data/db:/data/db
      - /mnt/containers/rocketchat/data/configdb:/data/configdb
    entrypoint: [ "/usr/bin/mongod", "--replSet", "rsmongo", "--bind_ip_all"]
    environment:
      MONGODB_REPLICA_SET_MODE: primary
      MONGODB_REPLICA_SET_NAME: rs0
      MONGODB_PORT_NUMBER: 27017
      MONGODB_INITIAL_PRIMARY_HOST: mongodb
      MONGODB_INITIAL_PRIMARY_PORT_NUMBER: 27017
      MONGODB_ADVERTISED_HOSTNAME: mongodb
      MONGODB_ENABLE_JOURNAL: "true"
      ALLOW_EMPTY_PASSWORD: "yes"

hi @lewy !

Sorry for the delay here :wink:

This is the doc you should look for: Managing Settings Using Environment Variables - Rocket.Chat Docs

TL;DR you can overwrite/define almost everything using ENV VARs.

So, for you case, you could set:

    ...
    labels:
      traefik.enable: 'false'
    environment:
      MONGO_URL: "mongodb://mongodb:27017/rocketchat?replicaSet=rs0"
      MONGO_OPLOG_URL: "mongodb://mongodb:27017/local?replicaSet=rs0"
      ROOT_URL: http://localhost:3021
      PORT: 3021
      OVERWRITE_SETTING_NOTIFICATIONS_SCHEDULE_DELAY_ONLINE: 1
      OVERWRITE_SETTING_NOTIFICATIONS_SCHEDULE_DELAY_AWAY: 1
      OVERWRITE_SETTING_NOTIFICATIONS_SCHEDULE_DELAY_OFFLINE: 1

    depends_on:
    ....

Let me know if this helps :slight_smile:

1 Like

All good! Thanks for your help.

I will test these out and get back to you if I run into any problems. Hopefully this will show up on Google for other folks looking to understand these settings too :slight_smile:

BTW do you have any idea what values here will get the behavior closest to WhatsApp/Messenger etc.?
Should I set them all to 1 like in your suggestion?

The clear message I am getting from my team is that the more I can get RC to behave like these familiar messaging apps, the easier the transition will go.

Hi!

This will all depend on the scale you have running versus the compute power you have for that.

If this setting is effective, you should consider decreasing it from the default value and monitor how your instance is behaving.

OK, thanks.

I did just set all values to 1 and did some quick testing. Notifications do seem almost instant now. I monitor over the next few weeks and report here if there’s any further issues.

1 Like

Reporting a couple of months after making these changes:

  • have not noticed any differences in resource usage. However we are still only 5 member on this instance, we will be expanding this soon.
  • all the complaints about notifications stopped - 3 users on Android, 2 on IOS

So I would consider this partially solved.

There’s still the issue that these settings are completely undocumented which is unacceptable.
I should not have had to spend several hours searching through GitHub issues and asking on the forum to find out how to apply these settings.
The flag OVERWRITE_SETTING_NOTIFICATIONS_SCHEDULE_DELAY_ONLINE would have been impossible to guess or infer without asking for help here.

1 Like

Hi Lewy!

Thanks for the inputs.

PRs are welcome!

Where do you think this information should go?

1 Like

I think the simplest way to document runtime config settings / environment variables in one single page that exhaustively lists all possible settings. I would put this in the Developer Quick Start guide.

Usually I see this done in a code block, with a short comment alongside each setting unless they are already clear:

// This is a list of all RocketChat config settings with default values:
// If you're using these in a docker compose file, prepend OVERWRITE_SETTING_ to each setting. 

NOTIFICATIONS_SCHEDULE_DELAY_ONLINE: 1,
NOTIFICATIONS_SCHEDULE_DELAY_AWAY: 1,
NOTIFICATIONS_SCHEDULE_DELAY_OFFLINE: 1 

... etc.

I presume such a config file already exists in some developer’s source code, right? Otherwise how do you remember and test all the settings?

If it does then you can basically just copy/paste it into a new docs page.

1 Like

Hi there,

I tried to access the referred document but am getting a “Page not found”. Where can I have access to the updated information about those variables?

Thank you,

Hi @dudanogueira, are there any updates on this? Was the information added to the documentation as suggested by @lewy?
I tried to find that in the documentation and I had a bad time as well. Fortunately, I found this discussion thread here.
I agree with @lewy that it should be better documented.
Thanks,

I don’t think those settings have changed.

Unfortunately they are not it the documentation that I can see.

Open an issue and see if someone will look at it.