You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Secured Push Notifications not loading content on ios #4199
Having installed a trial version of Rocket.Chat enterprise in order to test the 'Secured Push Notifications' feature. It appears this does not work as expected. My android client works well and the notification loads the content (by message ID) as expected. For ios however, the notification content does not load and the notification shows a generic 'You have a new message' message.
Debugging shows that
the call from the ios app to /api/v1/push.get?id=... gets a 401. It tries 5 times to load the notification but then gives up and displays the generic message. Further investigation shows that the ios app does not include a x-auth-token header.
The call from the android app to /api/v1/push.get?id= does include a x-auth-token header and returns successfully with a HTTP 200 response
Environment Information:
Rocket.Chat Server Version: 4.7.0
Rocket.Chat App Version: 4.27.1 (ios app)
Device Name: Iphone 12
OS Version: 15.4.1
Steps to reproduce:
Installed Rocket.Chat using docker-compose
Registered the installation and enabled a trial version of Enterprise Edition
Create admin user user1
Create user2 on browser client
Log in to ios app as user2 and close the app
Log in to browser client as user1
send a message in the browser client as user1, tagging user 2, e.g. @user2 test1
Observe that after a delay a Push notification is received in the ios app, however only a generic 'you have a new message'
Expected behavior:
ios should display a push notification with the content 'test1'
Actual behavior:
ios (After a delay) displays a push notification with generic content of 'you have a new message'
Additional context:
as mentioned above, use tcpdump and analyse to show that the call to load the notification by ID from the ios app did not include a x-auth-token and resulted in a 401 (Unauthorized). This happens 5 times before the app displays the generic notification text.
With Secure Push feature a have a bit different experience.
Most of mobile clients are works perfect, they show message content in Secured Push.
But there is some clients (a lot of them actually) that shows generic message.
Majority of clients with that issue is definitely iOS clients.
But I have users reports about same generic message on Android too!
Here is a screen:
Here is an iOS screen
There is a temporary workaround - delete app and then install it again. That manipulation fixes Secured Push for some time, but not permanently - it will broke again.
And I definitely saw when user first gets generic push message, but then after some time and without re-install of mobile application that same user gets proper message content.
So, my guess is not the only mobile client issue, it could be some server related issue too, or even both. @sampaiodiegoagreed with me.
In fact that wonderful feature should be polished to bright like a diamond.
Well it does make no sense, but disabling the option "Fetch full message content from the server on receipt" under "Push -> Privacy" fixed all our problems while still getting all of the message content.
Well it does make no sense, but disabling the option "Fetch full message content from the server on receipt" under "Push -> Privacy" fixed all our problems while still getting all of the message content.
It makes a lot of sense, because now all content of push message go through Apple and Google servers if Fetch full message content from the server on receipt is disabled.
@ankar84@james-surevine I've been trying to reproduce this on Mobile 4.29 (and on the unreleased 4.30) and Server 5.0, but it's working all the time.
Going through logs I can see the requests are fetching the message content as expected.
Please run your tests and let me know if it's working for you.
We can reopen if needed.
As I told you here, majority of the clients works perfect for some time, but then suddenly some of that clients start get dummy push messages. App reinstall fix that problem immediately, bit not permanently.
That all confirms the theory, that the unmarhaling of the JSON data is failing because of the outdated model, and I simply made a mistake with the direct messages.
@diegolmello We are on 6.2.10 server version finally!
And base mobile version for our users is 4.39.0
We enabled Secured Push on our server today and definitely can tell that this bug is totally fixed!
But I see some reports, that generic "You have new message" still appears.
Still checking details with @shiryov
But I see some reports, that generic "You have a new message" still appears.
The message should be displayed in rare cases still, but not as an issue.
The rate limiter is applied to push.get, so if you receive too many push notifications at once, you won't be able to fetch every message content, so "You have a new message" is going to be shown.
If it appears, but not because of rate limiter, please let us know.
Hello @diegolmello I'm from @ankar84 team
yes, we have a rate limiter enabled with these parameters:
And we tried to increase "Default Number Calls" to the maximum values of the graph above, it did not work - the messages came without text.
Maybe a problem in the long execution of the request, 2 seconds is not too long for android/ios push service?
If you changed it to 200, it might not be a rate limiter issue.
Can you disable rate limiter completely just to test this?
It shouldn't affect your operation that much for a quick test.
(I could argue 200 is almost like the rate limiter is disabled already...)
Maybe a problem in the long execution of the request, 2 seconds is not too long for android/ios push service?
I don't think so. We have 30 seconds to fetch and change the content of a push notification once it's received.
2 seconds for a request is not unusual.
Hello @diegolmello
Completely disabling rate limiter seems to have solved the problem.
Already 3 working days (with disabled limiter) security pushes come to both Android and Apple devices with text.
But on product environment rate limiter is required.
With a limit of 200 per minute, pushes definitely does not work. Based on our graph and the number of instances - 20, in order for push notifications to work, we need to increase the limit to 50000/20=2500, right?
You should not be hitting the rate limiter with those numbers, specially not very frequently. Is the issue still present on both platforms, or mostly one over the other?
Do you have any metric with number of push notifications sent per minute that you could compare to the number of requests to push.get?
One possibility I can think of is that the rate limiter is for some reason counting requests from multiple/all users as if they were from the same origin, then hitting the limit much earlier because of that. Is there anything out of ordinary in your network that could maybe affect this?
Activity
diegolmello commentedon May 16, 2022
Great job, @james-surevine!
The issue might be around here.
Can you work on a fix?
Thanks!
ankar84 commentedon May 17, 2022
@james-surevine agree with Diego, great investigation!
With Secure Push feature a have a bit different experience.


Most of mobile clients are works perfect, they show message content in Secured Push.
But there is some clients (a lot of them actually) that shows generic message.
Majority of clients with that issue is definitely iOS clients.
But I have users reports about same generic message on Android too!
Here is a screen:
Here is an iOS screen
There is a temporary workaround - delete app and then install it again. That manipulation fixes Secured Push for some time, but not permanently - it will broke again.
And I definitely saw when user first gets generic push message, but then after some time and without re-install of mobile application that same user gets proper message content.
So, my guess is not the only mobile client issue, it could be some server related issue too, or even both.
@sampaiodiego agreed with me.
In fact that wonderful feature should be polished to bright like a diamond.
diegolmello commentedon May 17, 2022
@ankar84 I was not aware about that commit on server.
Can you keep us updated once it's landed and tested by your team?
ankar84 commentedon May 17, 2022
Sure! I will update all that related information when that commit will land to new docker image, guess it will be 4.8.0 soon.
ankar84 commentedon Jun 11, 2022
4.8.1 didn't fix that issue

thakilla commentedon Aug 25, 2022
Well it does make no sense, but disabling the option "Fetch full message content from the server on receipt" under "Push -> Privacy" fixed all our problems while still getting all of the message content.
ankar84 commentedon Aug 26, 2022
It makes a lot of sense, because now all content of push message go through Apple and Google servers if
Fetch full message content from the server on receiptis disabled.diegolmello commentedon Aug 31, 2022
@ankar84 @james-surevine I've been trying to reproduce this on Mobile 4.29 (and on the unreleased 4.30) and Server 5.0, but it's working all the time.
Going through logs I can see the requests are fetching the message content as expected.
Please run your tests and let me know if it's working for you.
We can reopen if needed.
diegolmello commentedon Aug 31, 2022
Nevermind.
For some reason, it's started to fail.
I'm still investigating.
ankar84 commentedon Aug 31, 2022
As I told you here, majority of the clients works perfect for some time, but then suddenly some of that clients start get dummy push messages. App reinstall fix that problem immediately, bit not permanently.
Rewrite the label/description of the Push_request_content_from_server…
Rewrite the label/description of the Push_request_content_from_server…
Rewrite the label/description of the Push_request_content_from_server…
15 remaining items
ansiwen commentedon Apr 11, 2023
That all confirms the theory, that the unmarhaling of the JSON data is failing because of the outdated model, and I simply made a mistake with the direct messages.
diegolmello commentedon Apr 11, 2023
Ok, I'm going to give it a try then.
diegolmello commentedon Apr 11, 2023
@ansiwen It actually fixed it!
We're going to make a release later this week.
Thanks for your help!
diegolmello commentedon Apr 11, 2023
@ankar84 Can you enable secured push on the next release?
ankar84 commentedon Apr 12, 2023
I will do it for sure and come back with feedback.
Thank you, @diegolmello
ankar84 commentedon Aug 4, 2023
@diegolmello We are on 6.2.10 server version finally!
And base mobile version for our users is 4.39.0
We enabled Secured Push on our server today and definitely can tell that this bug is totally fixed!
But I see some reports, that generic "You have new message" still appears.
Still checking details with @shiryov
ankar84 commentedon Aug 4, 2023
Here is a one example of generic message received today

It's android, RC mobile version 4.39.0
push.getendpoint look works gooddiegolmello commentedon Aug 4, 2023
Awesome. Thanks for letting us know, @ankar84!
The message should be displayed in rare cases still, but not as an issue.
The rate limiter is applied to
push.get, so if you receive too many push notifications at once, you won't be able to fetch every message content, so "You have a new message" is going to be shown.If it appears, but not because of rate limiter, please let us know.
ankar84 commentedon Aug 4, 2023
Thank you Diego!!
I will check if it is rate limiter or not and come back with answer.
shiryov commentedon Aug 10, 2023
Hello @diegolmello I'm from @ankar84 team

yes, we have a rate limiter enabled with these parameters:
And we tried to increase "Default Number Calls" to the maximum values of the graph above, it did not work - the messages came without text.

Maybe a problem in the long execution of the request, 2 seconds is not too long for android/ios push service?
diegolmello commentedon Aug 10, 2023
If you changed it to 200, it might not be a rate limiter issue.
Can you disable rate limiter completely just to test this?
It shouldn't affect your operation that much for a quick test.
(I could argue 200 is almost like the rate limiter is disabled already...)
I don't think so. We have 30 seconds to fetch and change the content of a push notification once it's received.
2 seconds for a request is not unusual.
shiryov commentedon Aug 15, 2023
Hello @diegolmello
Completely disabling rate limiter seems to have solved the problem.
Already 3 working days (with disabled limiter) security pushes come to both Android and Apple devices with text.
But on product environment rate limiter is required.
With a limit of 200 per minute, pushes definitely does not work. Based on our graph and the number of instances - 20, in order for push notifications to work, we need to increase the limit to 50000/20=2500, right?
diegolmello commentedon Aug 15, 2023
Glad it worked!
I'm not an expert on our rate limiting system.
Perhaps you can move this discussion to a place where backenders can see it?
pierre-lehnen-rc commentedon Aug 23, 2023
You should not be hitting the rate limiter with those numbers, specially not very frequently. Is the issue still present on both platforms, or mostly one over the other?
Do you have any metric with number of push notifications sent per minute that you could compare to the number of requests to push.get?
One possibility I can think of is that the rate limiter is for some reason counting requests from multiple/all users as if they were from the same origin, then hitting the limit much earlier because of that. Is there anything out of ordinary in your network that could maybe affect this?