Skip to content

Secured Push Notifications not loading content on ios #4199

Closed

Description

@james-surevine

Description:

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

  1. 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.
  2. 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:

  1. Installed Rocket.Chat using docker-compose
  2. Registered the installation and enabled a trial version of Enterprise Edition
  3. Create admin user user1
  4. Create user2 on browser client
  5. Log in to ios app as user2 and close the app
  6. Log in to browser client as user1
  7. send a message in the browser client as user1, tagging user 2, e.g. @user2 test1
  8. 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.

Activity

  1. diegolmello commented on May 16, 2022

    @diegolmello
    Member

    Great job, @james-surevine!
    The issue might be around here.

    Can you work on a fix?

    Thanks!

  2. ankar84 commented on May 17, 2022

    @ankar84
    Contributor

    @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:
    image
    Here is an iOS screen
    image

    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.

  3. diegolmello commented on May 17, 2022

    @diegolmello
    Member

    @ankar84 I was not aware about that commit on server.
    Can you keep us updated once it's landed and tested by your team?

  4. ankar84 commented on May 17, 2022

    @ankar84
    Contributor

    Can you keep us updated once it's landed and tested by your team?

    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.

  5. ankar84 commented on Jun 11, 2022

    @ankar84
    Contributor

    4.8.1 didn't fix that issue
    image

  6. thakilla commented on Aug 25, 2022

    @thakilla

    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.

    Bildschirmfoto 2022-08-25 um 16 41 36

  7. ankar84 commented on Aug 26, 2022

    @ankar84
    Contributor

    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.

  8. diegolmello commented on Aug 31, 2022

    @diegolmello
    Member

    @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.

  9. diegolmello commented on Aug 31, 2022

    @diegolmello
    Member

    Nevermind.
    For some reason, it's started to fail.
    I'm still investigating.

  10. ankar84 commented on Aug 31, 2022

    @ankar84
    Contributor

    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.

  11. 15 remaining items

  12. ansiwen commented on Apr 11, 2023

    @ansiwen

    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.

  13. diegolmello commented on Apr 11, 2023

    @diegolmello
    Member

    Ok, I'm going to give it a try then.

  14. diegolmello commented on Apr 11, 2023

    @diegolmello
    Member

    @ansiwen It actually fixed it!
    We're going to make a release later this week.
    Thanks for your help!

  15. diegolmello commented on Apr 11, 2023

    @diegolmello
    Member

    @ankar84 Can you enable secured push on the next release?

  16. ankar84 commented on Apr 12, 2023

    @ankar84
    Contributor

    @ankar84 Can you enable secured push on the next release?

    I will do it for sure and come back with feedback.
    Thank you, @diegolmello

  17. ankar84 commented on Aug 4, 2023

    @ankar84
    Contributor

    @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

  18. ankar84 commented on Aug 4, 2023

    @ankar84
    Contributor

    Here is a one example of generic message received today
    It's android, RC mobile version 4.39.0
    image

    push.get endpoint look works good
    image

  19. diegolmello commented on Aug 4, 2023

    @diegolmello
    Member

    Awesome. Thanks for letting us know, @ankar84!

    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.

  20. ankar84 commented on Aug 4, 2023

    @ankar84
    Contributor

    Thank you Diego!!
    I will check if it is rate limiter or not and come back with answer.

  21. shiryov commented on Aug 10, 2023

    @shiryov

    Hello @diegolmello I'm from @ankar84 team
    yes, we have a rate limiter enabled with these parameters:
    image

    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?
    image

  22. diegolmello commented on Aug 10, 2023

    @diegolmello
    Member

    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.

  23. shiryov commented on Aug 15, 2023

    @shiryov

    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?

    image

  24. diegolmello commented on Aug 15, 2023

    @diegolmello
    Member

    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?

  25. pierre-lehnen-rc commented on Aug 23, 2023

    @pierre-lehnen-rc
    Contributor

    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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions