Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

[BUG] Notifications not working #654

Closed
Wouter0100 opened this issue Dec 22, 2017 · 27 comments
Closed

[BUG] Notifications not working #654

Wouter0100 opened this issue Dec 22, 2017 · 27 comments

Comments

@Wouter0100
Copy link

Wouter0100 commented Dec 22, 2017

Since I installed 0.59.3 and after that switched to a Oneplus 5T push notifications stopped working at all. Strangely enough, my colleagues seems to experience similar issues.

At first, the "Send a test push to my user"-button was working in the Settings => Push page, but that stopped working too recently (around the same time I switched to the 5T). When doing debugging with some logs, it seems I have registered 4 devices. But, after pressing "Send a test push to my user" some times (2-3 times) 1 push token is removed from the devices and so, pressing again will only send the test notification to 3 devices. After clearing my Rocket.Chat+ data on my Oneplus 5T and login in again, I have 4 push tokens (devices) again, but still no notifications are received. It seems my device is not receiving them properly, and so is removed.

Logs from Rocket.Chat:

�[34mI20171222-00:01:25.850(0) Push: send message "@wvanos" via query { userId: 'mMvjThapLYfBCah4P' } 
�[34mI20171222-00:01:25.853(0) Push: send to token { gcm: 'TOKEN_1' } 
�[34mI20171222-00:01:25.856(0) Push: send to token { gcm: 'TOKEN_2' } 
�[34mI20171222-00:01:25.858(0) Push: send to token { gcm: 'TOKEN_3' } 
�[34mI20171222-00:01:25.860(0) Push: send to token { gcm: 'TOKEN_4' } 
�[34mI20171222-00:01:26.123(0) removing push token TOKEN_3 
�[34mI20171222-00:01:50.934(0) Push: send message "@wvanos" via query { userId: 'mMvjThapLYfBCah4P' } 
�[34mI20171222-00:01:50.936(0) Push: send to token { gcm: 'TOKEN_1' } 
�[34mI20171222-00:01:50.939(0) Push: send to token { gcm: 'TOKEN_2' } 
�[34mI20171222-00:01:50.944(0) Push: send to token { gcm: 'TOKEN_4' } 
--- Relogging --
�[34mI20171222-00:05:11.687(0) Push: send message "@wvanos" via query { userId: 'mMvjThapLYfBCah4P' } 
�[34mI20171222-00:05:11.690(0) Push: send to token { gcm: 'TOKEN_1' } 
�[34mI20171222-00:05:11.694(0) Push: send to token { gcm: 'TOKEN_2' } 
�[34mI20171222-00:05:11.696(0) Push: send to token { gcm: 'TOKEN_4' } 
�[34mI20171222-00:05:11.697(0) Push: send to token { gcm: 'TOKEN_5' } 

I'm not sure how to debug the app and get some logs here, unfortunately. Should logcat work?

Strangely enough, https://gateway.rocket.chat/ is down now. But at the time of testing it wasn't.

  • Your Rocket.Chat.Android app version: 1.0.33 (not sure how this is possible, as the latest is 1.0.31 on Github?)
  • Your Rocket.Chat server version: 0.59.3
  • Device model (or emulator) you're running with: Oneplus 5T, stock ROM (Android Nougat).
  • Steps to reproduce:
    Trigger a push notification in any way.
@Wouter0100 Wouter0100 changed the title Notifications not properly send Notifications not working Dec 22, 2017
@Wouter0100 Wouter0100 changed the title Notifications not working [BUG] Notifications not working Dec 22, 2017
@rafaelks
Copy link
Contributor

@Wouter0100 Thank you for opening the issue. Just to make sure, is the pushes working after the gateway is online again?

@Wouter0100
Copy link
Author

Does not work, unfortunately.

@Wouter0100
Copy link
Author

Upgraded 0.60.1, unfortunately still no luck, although log messages seems to be a little more verbose:

�[34mI20171228-08:16:39.459(0) Push: send message "@wvanos" via query { userId: 'mMvjThapLYfBCah4P' } 
�[34mI20171228-08:16:39.461(0) Push: send to token { gcm: 'token 1' } 
�[34mI20171228-08:16:39.465(0) Push: send to token { gcm: 'token 2' } 
�[34mI20171228-08:16:39.467(0) Push: send to token { gcm: 'token 3' } 
�[34mI20171228-08:17:24.695(0) Push: Got push token from app: { id: 'f0de4ab328a44e4cb81e3abd8604a758',   appName: 'main',   userId: 'mMvjThapLYfBCah4P',   metadata: {},   token:     { gcm: 'token 3' } } 
�[34mI20171228-08:17:24.704(0) Push: updated { _id: 'f0de4ab328a44e4cb81e3abd8604a758',   token:     { gcm: 'token 3' },   appName: 'main',   userId: 'mMvjThapLYfBCah4P',   enabled: true,   createdAt: 2017-12-22T00:04:49.069Z,   updatedAt: 2017-12-28T08:16:16.951Z } 
�[34mI20171228-08:17:25.030(0) Push: Settings userId "mMvjThapLYfBCah4P" for app: f0de4ab328a44e4cb81e3abd8604a758 
�[34mI20171228-08:17:47.577(0) Push: send message "@wvanos" via query { userId: 'mMvjThapLYfBCah4P' } 
�[34mI20171228-08:17:47.581(0) Push: send to token { gcm: 'token 1' } 
�[34mI20171228-08:17:47.584(0) Push: send to token { gcm: 'token 2' } 
�[34mI20171228-08:17:47.586(0) Push: send to token { gcm: 'token 3' } 

@rafaelks
Copy link
Contributor

rafaelks commented Jan 2, 2018

@Wouter0100 Did you have any luck? Is it working right now? Could you try uninstalling and installing your app again (we've a version of the app in Beta that fixes it).

@Wouter0100
Copy link
Author

Good you ask - weirdly enough I did receive 2 notifications on new years eve from a specific channel. After some more debugging and testing, I wasn't able to reproduce those notifications on new years day.

Also the test push button still does not work (or atleast, I don't receive the notifications).

@rafaelks
Copy link
Contributor

rafaelks commented Jan 2, 2018

@Wouter0100 Interesting. I'll check with back-end team if we changed something in the past days. Are you using our gateway, correct?

@Wouter0100
Copy link
Author

@rafaelks yes, I am. What is the best way to debug the app and are there log lines in place for receiving notifications? This because I'm wondering if the test button notifications are not filtered in the app's side.

@rafaelks
Copy link
Contributor

rafaelks commented Jan 2, 2018

@Wouter0100 The best way to debug this is to create two users, log with one on the web and one in the app. Kill the app and send a message to that user from the web. If you don't receive a notification in ~1 minute, something is wrong. Make sure your notifications are enabled in your device, you have all the permissions enabled and everything else to make the test, please.

@Wouter0100
Copy link
Author

Hmmm - I did some testing, and weirdly enough, sometimes notificaties gets through (although, very late and not useful). Yesterday I tested and I received a notification once for a new livechat session, 30 minutes late (and which I already replied to). I will do some further testing next week.

@rafaelks
Copy link
Contributor

rafaelks commented Jan 5, 2018

@sampaiodiego Can you help us investigating the issue here? I don't see any problem with my iOS notifications, but some people complain about the Android ones. @Wouter0100 Do you see the calls being made to our gateway? Does it return some kind of error or something? Also, are you testing with a stable internet connection?

Thanks for your patience!

@Wouter0100
Copy link
Author

Yes, the internet connection is stable. Rocket.Chat is hosted within a DC and my phone is most of the time on Wi-Fi or a reliable 4G connection. There are no errors within the Rocket.Chat logs. Notifications seem to be send just fine.

Hmm - livechat seems to work fine now. Although, the channel is send as "#undefined" and I can't quick reply, but the notification is received without delay (even if I have the webclient open and in-focus, not sure if that's okay, but hey, it works).

Will later test other channels again, as this was a normal livechat session.

@rafaelks
Copy link
Contributor

rafaelks commented Jan 5, 2018

@Wouter0100 Sounds good! Regarding the live chat, I think this is a bug @sampaiodiego & @rodrigok, can we fix it for next release please? (cc @theorenck).

@Wouter0100
Copy link
Author

@rafaelks ah, okay. Is the "Send a test push to my user" also a bug, because it isn't working?

@rafaelks
Copy link
Contributor

rafaelks commented Jan 5, 2018

@Wouter0100 We identified that the "Test push" is a bug in our app, but the other issue with "undefined" is going to be fixed. @leonardoaramaki Is the test push something we stopped supporting in the past releases, because of that checks we made? Can we add the support again (in a secure way)?

@sampaiodiego
Copy link
Member

@Wouter0100 once the guys fix receiving notifications from the "test push" button, this is the most reliable way for testing receiving push notifications.. because it forces the server to send a push notification to each device you have registered.

on the livechat push issue, do you mind opening an issue on main repo? this is something I have noticed before but didn't have time to fix.. having an issue will help us tracking it down. thx

@Wouter0100
Copy link
Author

@rafaelks I thought something like that, indeed. Because the channel/user doesn't really exists, for example, this is easily overseen when implemented such a check.

@sampaiodiego done. RocketChat/Rocket.Chat#9341

Thanks for the fast responses and awesome support!

@pkostiuk
Copy link

pkostiuk commented Jan 9, 2018

@sampaiodiego is there an issue to track the notifications bug that isn't related to LiveChat?

@sampaiodiego
Copy link
Member

which one @pkostiuk ?

@pkostiuk
Copy link

The issue of notifications not working. I'm experiencing the same problem with Android devices (native and Cordova app). I assume it's an issue with Rocket.Chat server and not the Android client.

@pkostiuk
Copy link

@sampaiodiego the updated Cordova app released today fixed the issue. Thanks for all the hard work!

@Wouter0100
Copy link
Author

Wouter0100 commented Jan 12, 2018

@pkostiuk seems like you're in the wrong repository, as this is one is related to the Rocket.Chat+ (native) app.

Regardless, I did some more digging: so notifications in general are working, somehow. I got the following logs. I was logged in the web the whole time (even when the livechat began):

- I SEND SOME MESSAGES -
�[34mI20180112-18:25:00.648(0) Push: send message "#datacenter" via query { userId: 'XXxC3DiYvtsRK8j4s' } 
�[34mI20180112-18:25:00.651(0) Push: send to token { gcm: 'token 1' } 
�[34mI20180112-18:25:00.653(0) Push: send to token { gcm: 'token 2' } 
�[34mI20180112-18:25:00.669(0) Push: send message "#datacenter" via query { userId: '2fjYPRagno3dfhYfE' } 
�[34mI20180112-18:25:00.671(0) Push: send to token { gcm: 'token 3' } 
�[34mI20180112-18:25:14.673(0) Push: send message "#datacenter" via query { userId: 'XXxC3DiYvtsRK8j4s' } 
�[34mI20180112-18:25:14.675(0) Push: send to token { gcm: 'token 1' } 
�[34mI20180112-18:25:14.676(0) Push: send to token { gcm: 'token 2' } 
�[34mI20180112-18:25:14.689(0) Push: send message "#datacenter" via query { userId: '2fjYPRagno3dfhYfE' } 
�[34mI20180112-18:25:14.691(0) Push: send to token { gcm: 'token 3' } 
�[34mI20180112-18:25:28.698(0) Push: send message "#datacenter" via query { userId: 'XXxC3DiYvtsRK8j4s' } 
�[34mI20180112-18:25:28.700(0) Push: send to token { gcm: 'token 1' } 
�[34mI20180112-18:25:28.702(0) Push: send to token { gcm: 'token 2' } 
�[34mI20180112-18:25:28.723(0) Push: send message "#datacenter" via query { userId: '2fjYPRagno3dfhYfE' } 
�[34mI20180112-18:25:28.726(0) Push: send to token { gcm: 'token 3' } 
- COLLEGE 2 LOGGED IN, AND SEND MESSAGES - 
�[34mI20180112-18:31:47.448(0) Push: Got push token from app: { id: '87fbc31ec3ec41efb70203164d551ff0',   appName: 'main',   userId: 'XXxC3DiYvtsRK8j4s',   metadata: {},   token:     { gcm: 'token 2' } } 
�[34mI20180112-18:31:47.470(0) Push: updated { _id: '87fbc31ec3ec41efb70203164d551ff0',   token:     { gcm: 'token 2' },   appName: 'main',   userId: 'XXxC3DiYvtsRK8j4s',   enabled: true,   createdAt: 2017-12-04T09:38:02.428Z,   updatedAt: 2018-01-12T15:37:39.426Z } 
�[34mI20180112-18:31:47.471(0) Push: Got push token from app: { id: '87fbc31ec3ec41efb70203164d551ff0',   appName: 'main',   userId: 'XXxC3DiYvtsRK8j4s',   metadata: {},   token:     { gcm: 'token 2' } } 
�[34mI20180112-18:31:47.477(0) Push: updated { _id: '87fbc31ec3ec41efb70203164d551ff0',   token:     { gcm: 'token 2' },   appName: 'main',   userId: 'XXxC3DiYvtsRK8j4s',   enabled: true,   createdAt: 2017-12-04T09:38:02.428Z,   updatedAt: 2018-01-12T18:31:47.461Z } 
�[34mI20180112-18:31:47.478(0) Push: Got push token from app: { id: '87fbc31ec3ec41efb70203164d551ff0',   appName: 'main',   userId: 'XXxC3DiYvtsRK8j4s',   metadata: {},   token:     { gcm: 'token 2' } } 
�[34mI20180112-18:31:47.490(0) Push: updated { _id: '87fbc31ec3ec41efb70203164d551ff0',   token:     { gcm: 'token 2' },   appName: 'main',   userId: 'XXxC3DiYvtsRK8j4s',   enabled: true,   createdAt: 2017-12-04T09:38:02.428Z,   updatedAt: 2018-01-12T18:31:47.472Z } 
�[34mI20180112-18:31:47.964(0) Push: Settings userId "XXxC3DiYvtsRK8j4s" for app: 87fbc31ec3ec41efb70203164d551ff0 
�[34mI20180112-18:31:48.361(0) Push: Got push token from app: { id: '87fbc31ec3ec41efb70203164d551ff0',   appName: 'main',   userId: 'XXxC3DiYvtsRK8j4s',   metadata: {},   token:     { gcm: 'token 2' } } 
�[34mI20180112-18:31:48.376(0) Push: updated { _id: '87fbc31ec3ec41efb70203164d551ff0',   token:     { gcm: 'token 2' },   appName: 'main',   userId: 'XXxC3DiYvtsRK8j4s',   enabled: true,   createdAt: 2017-12-04T09:38:02.428Z,   updatedAt: 2018-01-12T18:31:47.483Z } 
�[34mI20180112-18:31:48.942(0) Push: Settings userId "XXxC3DiYvtsRK8j4s" for app: 87fbc31ec3ec41efb70203164d551ff0 
�[34mI20180112-18:32:00.610(0) Push: send message "#datacenter" via query { userId: '2fjYPRagno3dfhYfE' } 
�[34mI20180112-18:32:00.613(0) Push: send to token { gcm: 'token 3' } 
- LIVECHAT BEGAN - 
�[34mI20180112-19:12:13.856(0) Push: send message "#undefined" via query { userId: 'mMvjThapLYfBCah4P' } 
�[34mI20180112-19:12:13.859(0) Push: send to token { gcm: 'token 4' } 
�[34mI20180112-19:12:13.863(0) Push: send to token { gcm: 'token 5' } 
�[34mI20180112-19:12:13.865(0) Push: send to token { gcm: 'token 6' } 

Then I opened the database to find out of those tokens are the correct ones, as there seem to be more devices in the current database then needed. Currently we are with 3 users (and a lot of livechat users), which have in total of 8 devices.

User 1 (me, mMvjThapLYfBCah4P): 3 devices, all enabled.

  • 2017-10-12 - 2017-11-12: token 4
  • 2017-11-02 - 2017-11-06: token 5
  • 2017-12-22 - 2018-01-12: token 6

College 1 (2fjYPRagno3dfhYfE): 1 device, enabled.

  • token 3

College 2 (XXxC3DiYvtsRK8j4s): 2 devices, all enabled.

  • 2017-10-13 - 2017-11-24: token 1
  • 2017-12-04 - 2018-01-12: token 2

Hmm - after I see this, it seem that there is just somethng wrong with my user (and that it's fixed for my college) - or some configuration. I do not receive notifications for channels, but for private messages and livechat messages I do. Also, this does not seem to be a issues for the Android app, as just notifications are not properly send for my user. Rather an issue for Rocket.Chat main repo.

@Wouter0100
Copy link
Author

Wouter0100 commented Jan 12, 2018

My preferences (from the DB) are:
image
They do not seem to differ from my college's.

I can't also seem to find a difference between the subscriptions. Everything is just.. The same.

image
Fiirst is college 2, then college 1, then me. These subscriptions are from the #datacenter channel, where the logs were from (and as you saw, I should've received a notification, didn't I?)

Am I missing something here?

@Wouter0100
Copy link
Author

Wouter0100 commented Jan 12, 2018

I now also tested when I was offline in the web interface (college sending a message in #datacenter channel). Nothing. Not even in logs.

@Wouter0100
Copy link
Author

College 2 says that he sometimes receives notifications, but sometimes he does not. All from the same #datacenter channel (just for testing, none of the channels work, but yeah).

@rafaelks
Copy link
Contributor

@Wouter0100 @sampaiodiego Is it possible that we're having some instability issues in our gateway? If the app sometimes and receives and sometimes don't, the issue looks like it's on server side, right? How could we detect if the push notification was sent or not?

@Wouter0100
Copy link
Author

@rafaelks sometimes notifications are really slow, sometimes fast and sometimes they won't arrive (bur are send).

@rafaelks
Copy link
Contributor

rafaelks commented Apr 3, 2018

Not valid anymore for version 2.0.0.

@rafaelks rafaelks closed this as completed Apr 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants