Rocket.Chat.Android icon indicating copy to clipboard operation
Rocket.Chat.Android copied to clipboard

[BUG] User doesnt get push token

Open TheReal1604 opened this issue 9 years ago • 23 comments

Your Rocket.Chat.Android version: playstore version

image

We tried to reinstall the app several times.. it seems that there is no push token, he get also no push notifications.

Hm, some users get push tokens, some not.

TheReal1604 avatar Feb 15 '17 19:02 TheReal1604

We are investigating this and we already have a lead.

I'll update this as we find out what's happening.

laggedHero avatar Feb 22 '17 17:02 laggedHero

I may have found out what's happening here. 🎉

laggedHero avatar Mar 09 '17 20:03 laggedHero

@TheReal1604 @stephane-

Version 1.0.6 may be the thing for you. The user will need to clean up the app data (re-register the server).

laggedHero avatar Mar 10 '17 16:03 laggedHero

Nice! It's work fine ! :) Great job 👍

CodazziS avatar Mar 10 '17 16:03 CodazziS

With the new update all works fine.

TheReal1604 avatar Mar 13 '17 15:03 TheReal1604

@laggedHero Have to reopen this issue.

Device: Nexus 6P Android: 7 Patchlevel from August

Installed the latest version from the playstore and doesnt get a push token. (Maybe it is connected with the deprecated GCM?)

TheReal1604 avatar Sep 01 '17 20:09 TheReal1604

@TheReal1604 I'm not working with RC anymore. But they got some nice and great developers with them.

;)

laggedHero avatar Sep 01 '17 20:09 laggedHero

@laggedHero Thanks for the info!

Maybe @filipedelimabrito or @luciofm can take a look? This is happening now for more and more users if they reinstall the app.

Thanks!

TheReal1604 avatar Sep 02 '17 17:09 TheReal1604

@TheReal1604 is this on rocketchat server or on a hosted one?

luciofm avatar Sep 04 '17 12:09 luciofm

@luciofm yes, I have this behavior on a rocket chat server that I host on my system. (Not an RC-Hosted one)

TheReal1604 avatar Sep 04 '17 19:09 TheReal1604

@luciofm some news on this?

TheReal1604 avatar Sep 11 '17 17:09 TheReal1604

Should be fixed on 1.0.18

On Mon, Sep 11, 2017 at 2:54 PM, TheReal1604 [email protected] wrote:

@luciofm https://github.com/luciofm some news on this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RocketChat/Rocket.Chat.Android/issues/206#issuecomment-328607436, or mute the thread https://github.com/notifications/unsubscribe-auth/AANr_1t1lJLcXdrGzBOoJ_PrTfMPHGvOks5shXPUgaJpZM4MCIRe .

-- Lucio MacielAndroid Engineer

[email protected]

@luciofm https://demo.rocket.chat/direct/luciofm

https://rocket.chat ᐧ

luciofm avatar Sep 11 '17 21:09 luciofm

No push notification either for me, tested in 1.0.18 and 1.0.20-DEBUG on Galaxy A3 android 6.0.1.

However, the "Send test notification to my user" button in "administration" -> "push" does work.

Alhrath avatar Oct 01 '17 12:10 Alhrath

@Alhrath Are you testing using our gateway to send push notification? It should work. If you're not using our gateway, I believe you'll need to change the keys into the app and build it yourself.

rafaelks avatar Oct 02 '17 09:10 rafaelks

@rafaelks I do use your gateway. I build actually the app from repo without any modification from develop branch (1.0.20-DEVELOP), but I tested it with different versions too and never got notification (1.0.18 from play store, rocket.chat from play store). I feel this is something very stupid I missed out but I ran out of ideas on where to check, so I will just list what I checked and hope someone will have some idea ... :p

  • When I go in "administration" -> "push" and do a "send test push notification to my user" it does work.
  • Most of my users do get notifications normally. A few of them "sometime" do not get their notifications.
  • But I never got any normal (aka not from test button) notification on my device. I usually test by sending a message from another test user both in channel and private message, both with and without mention.
  • On server settings, desktop notifications are set to "mention" and mobile ones are set to "all messages".
  • On my account settings, both are set to default.
  • On my account settings, preserve mobile bandwidth is set to "yes" and unread room mode is set to "false", but I tested playing with these options without success.
  • On my phone settings, notifications are on (I get other app notif) and volume set to maximum.
  • "Do not disturb" option is off. I also tried to put rocket.chat+ on priority list there without success.
  • Applications notifications is set to "authorize" for rocket.chat+, and none of the "hide if whatever" options is set.
  • Energy saving option for applications is set to deactivated for Rocket.Chat+
  • I tried to make another user who do get notifications to log in on my phone and tried without success to get notif on their account.

My server is still in 0.58.2 (was waiting for 0.59.x stable to update) but if you think it can change anything I can try to update it to 0.58.3 or any pre-release.

If you have any idea, I will be happy to provide more info. I have access to every logs server side and client side if needed.

Alhrath avatar Oct 03 '17 09:10 Alhrath

@Alhrath Thanks for all your feedback. I've few tests that we can do in order to find the bug:

  1. Can you create a new account at the same server, login into your Android and try to send a test push? If it works, all the other pushes works?
  2. Do you receive the test push? I'm sorry but I couldn't understand if you can or cannot receive it;
  3. Do you see the pushes being sent on the server (debugging)?

rafaelks avatar Oct 04 '17 22:10 rafaelks

  1. Created new user, logged in with my android, sent private message from my normal account to the new user, notification received ... :p So it's not my mobile config problem ...
  2. Yes, test push are received on my mobile even with the buggy account.
  3. Some debug logs :
  • Test push (notification received as intended) :

[34mI20171005-13:10:08.133(2) [34mMeteor ➔ method push_test -> userId: dQjzwXPCu3J69tmQk , arguments: {} [34mI20171005-13:10:08.573(2) Push: send message "@jonas" via query { userId: 'dQjzwXPCu3J69tmQk' } [34mI20171005-13:10:08.582(2) Push: send to token { gcm: 'dqbmsicLBtI:APA91bHvmOhQZrW61vaeu3NaL_-t1JrSoIOloSC21CETc9JDsiNIELD2p8xONTL979B3xUoDRSQqd3zaNTLUSxA2kFUgXxhS3WekSWfdlSWhhshqEBNkRXK3qhU7dJQQxpCi4Yj_1aNN' } [34mI20171005-13:10:08.594(2) Push: send to token { gcm: 'ewa7gDQiyFY:APA91bHTujgbtVT0GkOEFDSHNBt0j3rKGjs34_fHtGT50ifEHxoFN-VGGggP2EK4G8YNupQ04JCL--qIYqyCw4wJ4qKuwgsoPs59jdDm0T9CuOxeP63nuToq9H8iGg48PIFqcyT7bf7o' } [34mI20171005-13:10:08.600(2) Push: send to token { gcm: 'eKE6_N-HWr4:APA91bFB9an8qLYaNmnSkWPAHJJKzY_5jy9w2tV7tkz4Y3CnemQR1lxPGgsedwHfwXkXoc9pRPtJ516BInVN8idZ5RTskseIo07uzJowQtQZiMY0d2We6ay23hnQFYs30ydkHrKWosCi' }

  • Normal private message from NewUser to my normal user (no notification received) :

I20171005-13:13:31.162(2) Meteor ➔ method stream-notify-room -> userId: wTFu5YDTQc3MRgis2 , arguments: { '0': 'dQjzwXPCu3J69tmQkwTFu5YDTQc3MRgis2/typing', '1': 'newuser', '2': true } I20171005-13:13:32.845(2) Meteor ➔ method stream-notify-room -> userId: wTFu5YDTQc3MRgis2 , arguments: { '0': 'dQjzwXPCu3J69tmQkwTFu5YDTQc3MRgis2/typing', '1': 'newuser', '2': false } I20171005-13:13:32.864(2) Meteor ➔ method sendMessage -> userId: wTFu5YDTQc3MRgis2 , arguments: { '0': { _id: 'BuiC8PqgTKKxqeaTR', rid: 'dQjzwXPCu3J69tmQkwTFu5YDTQc3MRgis2', msg: 'test' } } I20171005-13:13:32.874(2) Meteor ➔ method canAccessRoom -> userId: wTFu5YDTQc3MRgis2 , arguments: { '0': 'dQjzwXPCu3J69tmQkwTFu5YDTQc3MRgis2', '1': 'wTFu5YDTQc3MRgis2' } I20171005-13:13:32.910(2) Meteor ➔ method canAccessRoom -> userId: wTFu5YDTQc3MRgis2 , arguments: { '0': 'dQjzwXPCu3J69tmQkwTFu5YDTQc3MRgis2', '1': 'aLJ82QjHCNLEjThZd' } I20171005-13:13:33.008(2) Integrations ➔ Outgoing WebHook.debug Execute Trigger: sendMessage I20171005-13:13:33.014(2) Integrations ➔ Outgoing WebHook.debug Got the event arguments for the event: sendMessage { event: 'sendMessage', message: { _id: 'BuiC8PqgTKKxqeaTR', rid: 'dQjzwXPCu3J69tmQkwTFu5YDTQc3MRgis2', msg: 'test', ts: Thu Oct 05 2017 13:13:32 GMT+0200 (CEST), u: { _id: 'wTFu5YDTQc3MRgis2', username: 'newuser', name: 'NewUser' }, mentions: [], channels: [], _updatedAt: Thu Oct 05 2017 13:13:32 GMT+0200 (CEST), sandstormSessionId: null }, room: { _id: 'dQjzwXPCu3J69tmQkwTFu5YDTQc3MRgis2', _updatedAt: Thu Oct 05 2017 13:13:05 GMT+0200 (CEST), t: 'd', msgs: 4, ts: Thu Oct 05 2017 12:42:11 GMT+0200 (CEST), meta: { revision: 4, created: 1507200131512, version: 0, updated: 1507201985833 }, '$loki': 51, username: 'newuser', lm: Thu Oct 05 2017 13:13:05 GMT+0200 (CEST), usernames: [ 'newuser', 'jonas' ] } } I20171005-13:13:33.018(2) Integrations ➔ Outgoing WebHook.debug Starting search for triggers for the room: dQjzwXPCu3J69tmQkwTFu5YDTQc3MRgis2 I20171005-13:13:33.022(2) Integrations ➔ Outgoing WebHook.debug Found 0 to iterate over and see if the match the event.

  • Mention in public channel from NewUser to my normal account (no notification received) :

I20171005-13:20:55.729(2) Meteor ➔ method stream-notify-room -> userId: wTFu5YDTQc3MRgis2 , arguments: { '0': 'AMgL4BqTsjgKRmxmH/typing', '1': 'newuser', '2': false } I20171005-13:20:55.759(2) Meteor ➔ method sendMessage -> userId: wTFu5YDTQc3MRgis2 , arguments: { '0': { _id: 'fb5i65c6wPMJ2p3QX', rid: 'AMgL4BqTsjgKRmxmH', msg: '@jonas ' } } I20171005-13:20:55.765(2) Meteor ➔ method canAccessRoom -> userId: wTFu5YDTQc3MRgis2 , arguments: { '0': 'AMgL4BqTsjgKRmxmH', '1': 'wTFu5YDTQc3MRgis2' } I20171005-13:20:55.831(2) Meteor ➔ method canAccessRoom -> userId: wTFu5YDTQc3MRgis2 , arguments: { '0': 'AMgL4BqTsjgKRmxmH', '1': 'aLJ82QjHCNLEjThZd' } I20171005-13:20:55.989(2) Integrations ➔ Outgoing WebHook.debug Execute Trigger: sendMessage I20171005-13:20:55.996(2) Integrations ➔ Outgoing WebHook.debug Got the event arguments for the event: sendMessage { event: 'sendMessage', message: { _id: 'fb5i65c6wPMJ2p3QX', rid: 'AMgL4BqTsjgKRmxmH', msg: 'Jones ', ts: Thu Oct 05 2017 13:20:55 GMT+0200 (CEST), u: { _id: 'wTFu5YDTQc3MRgis2', username: 'newuser', name: 'NewUser' }, mentions: [ [Object] ], channels: [], _updatedAt: Thu Oct 05 2017 13:20:55 GMT+0200 (CEST), sandstormSessionId: null }, room: { name: 'test', fname: 'test', t: 'c', msgs: 34, u: { _id: 'dQjzwXPCu3J69tmQk', username: 'jonas' }, customFields: {}, ts: Sat Sep 23 2017 18:19:44 GMT+0200 (CEST), ro: false, sysMes: true, _updatedAt: Thu Oct 05 2017 13:18:33 GMT+0200 (CEST), _id: 'AMgL4BqTsjgKRmxmH', meta: { revision: 36, created: 1506183584402, version: 0, updated: 1507202313671 }, '$loki': 41, username: 'newuser', lm: Tue Oct 03 2017 11:12:56 GMT+0200 (CEST), usernames: [ 'jonas', 'nietzsche', 'newuser' ] } } I20171005-13:20:56.002(2) Integrations ➔ Outgoing WebHook.debug Starting search for triggers for the room: AMgL4BqTsjgKRmxmH I20171005-13:20:56.005(2) Integrations ➔ Outgoing WebHook.debug Found 0 to iterate over and see if the match the event. I20171005-13:20:56.419(2) Push: send message "#test" via query { userId: 'uiQQZ764ZNNTq8QP8' } (Last userId above is the id of another test user who is also in the #test public channel but was not mentionned)

###################

It also gave me some ideas. First of all I realized the my user had only "admin" role and not the "user" one, so I added it, but it didn't changed anything. I feel like it's a user configuration problem, so I connected to the mongodb and tried to rename the "settings" fields of my user in "bkp_settings" but without success either. Here is the mongo data of the new user (working) :

{ "_id" : "wTFu5YDTQc3MRgis2", "createdAt" : ISODate("2017-10-05T12:37:19.530+02:00"), "services" : { "password" : { "bcrypt" : "######################################" }, "resume" : { "loginTokens" : [ { "when" : ISODate("2017-10-05T12:41:57.183+02:00"), "hashedToken" : "EFvz63uQP4mUutMANMnKl4wQJNxQWoHQUD1mlfi4IBA=" }, { "when" : ISODate("2017-10-05T12:54:49.775+02:00"), "hashedToken" : "/yArdqzLlQCACrrUP5SpOAtPeIfWUZdygiCCI2k2Uzc=" }, { "when" : ISODate("2017-10-05T13:12:37.546+02:00"), "hashedToken" : "4U+fHZyKDStB2n6wo05bJ/RoIiZT0D2zGROgzSdECUw=" } ] } }, "username" : "newuser", "emails" : [ { "address" : "[email protected]", "verified" : false } ], "type" : "user", "status" : "online", "active" : true, "name" : "NewUser", "_updatedAt" : ISODate("2017-10-05T13:12:42.089+02:00"), "roles" : [ "user" ], "lastLogin" : ISODate("2017-10-05T13:12:37.525+02:00"), "statusConnection" : "online", "utcOffset" : NumberInt("2") }

And the data of my normal user (not working) :

{ "_id" : "dQjzwXPCu3J69tmQk", "createdAt" : ISODate("2017-08-27T21:32:14.799+02:00"), "services" : { "password" : { "bcrypt" : "#####################################################" }, "ldap" : { "id" : "31303234", "idAttribute" : "uidNumber" }, "resume" : { "loginTokens" : [ { "when" : ISODate("2017-09-24T00:18:18.441+02:00"), "hashedToken" : "SSv22SAjpOHRWiRkUbXRGh+P2+ti7aw7Lfn59/6KVqI=" }, { "when" : ISODate("2017-09-24T00:20:23.874+02:00"), "hashedToken" : "saeXQihuHI1KVvxUloqqSwguSYJMPc7q/xAjGSrRlec=" }, [ ............ ] { "when" : ISODate("2017-10-05T13:09:09.875+02:00"), "hashedToken" : "ik/f4zDDmhD6GRrwfTgpvDT6GxnKcw4DyGzVc5hyl4U=" }, { "when" : ISODate("2017-10-05T13:09:10.175+02:00"), "hashedToken" : "7hIrnyBxr3+7HKLde+tGfHpPi4wQm85FZAX9awLmgXA=" } ] } }, "username" : "jonas", "emails" : [ { "address" : "[email protected]", "verified" : false } ], "type" : "user", "status" : "online", "active" : true, "name" : "Jones", "_updatedAt" : ISODate("2017-10-05T13:12:27.641+02:00"), "roles" : [ "admin", "user" ], "ldap" : true, "lastLogin" : ISODate("2017-10-05T13:12:20.290+02:00"), "statusConnection" : "online", "utcOffset" : NumberInt("2"), "statusDefault" : "online", "requirePasswordChange" : false, "avatarOrigin" : "url", "language" : "fr", "bkp_settings" : { "profile" : {

  },
  "preferences" : {
  	"newRoomNotification" : "door",
  	"newMessageNotification" : "chime",
  	"useEmojis" : true,
  	"convertAsciiEmoji" : true,
  	"saveMobileBandwidth" : true,
  	"collapseMediaByDefault" : false,
  	"unreadRoomsMode" : false,
  	"autoImageLoad" : true,
  	"emailNotificationMode" : "all",
  	"unreadAlert" : true,
  	"notificationsSoundVolume" : NumberInt("100"),
  	"desktopNotifications" : "default",
  	"mobileNotifications" : "default",
  	"desktopNotificationDuration" : NumberInt("0"),
  	"viewMode" : NumberInt("0"),
  	"hideUsernames" : false,
  	"hideRoles" : false,
  	"hideAvatars" : false,
  	"hideFlexTab" : false,
  	"highlights" : [ ],
  	"sendOnEnter" : "normal"
  }

} }

Last thing : I did all these tests in 1.0.20. I will now update to 1.0.21 ans will let you know if it changes anything, but I feel it wont since I do get notifications logged as NewUser on this version.

Thanks for your help :)

Alhrath avatar Oct 05 '17 11:10 Alhrath

No change with 1.0.21-DEBUG as expected.

I tried to play with my user mongo data, giving a "bkp_" prefix to field names where I could, but without success.

I also tried another thing : in "_raix_push_app_token" mongo table, I got 4 entries for my user, last one appears to be my android smartphone (user change to NewUser ID when I log with it). I tried to change userID to something else in the 3 previous ones (witch are probably tokens from other phones I logged in if I get it correctly, or previous versions of rocket.chat I had), but again, no notification received ...

And I confirm again that NewUser logged on my phone still get all notifications. So it has to be something with my user specifically ...

EDIT: tried to take out admin role to my user, no changes.

Alhrath avatar Oct 08 '17 13:10 Alhrath

SOLVED! :)

I found out the problem : there was a rogue entry in "usersSessions" connections field. Deleting it solved the problem. I get notifications normally now :)

Alhrath avatar Oct 08 '17 14:10 Alhrath

Excellent! Thank you!

rafaelks avatar Oct 09 '17 09:10 rafaelks