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

Recieving push notifcations for all messages

Open royalaid opened this issue 10 years ago • 14 comments

Your Rocket.Chat version: 0.20, minus one commit because that is what docker is pulling I am having a weird issue where it seems that all messages, including my own, on public channels and private chats directed at me trigger a push notification. I have checked all the push notification settings I can find, rebooted the server, and toggled push notifications in the admin panel and nothing seems to change it. I have push notifications currently turned off in all channels too and yet still receive them.

royalaid avatar Mar 01 '16 22:03 royalaid

Do you mean the Desktop Notifications? Or Mobile Push Notifications? Are there other users on your instance, do they also experience this?

marceloschmidt avatar Mar 02 '16 14:03 marceloschmidt

Different instance, but we have at least to Mac users with this problem. I am one of them. We are using Rocket.Chat 19.0, Rocket.Chat.Electron for Mac 1.1.0 and the iOS-App. Which infos would help to identify the problem?

homberger avatar Mar 02 '16 15:03 homberger

I'm on the same instance as @homberger and also receive notifications (desktop and push) for each and every message (even my own in some channels!)

ulope avatar Mar 02 '16 15:03 ulope

@homberger and @ulope do you mean the Desktop Notifications, like this one:

image

Or the mobile notification, received on your phone? Maybe on both?

Thanks

marceloschmidt avatar Mar 02 '16 16:03 marceloschmidt

I'm getting this as well , server version 0.19.0 dev branch (6dcfadfb64cb931c0a8536e6188c8f82692c346f) , client is rocketchat electron 1.1.0 release , OSX El Capitan

Here is my user document:

{ "_id" : "<removed>", "createdAt" : ISODate("2016-02-16T16:22:15.563Z"), "services" : { "password" : { "bcrypt" : "<removed" }, "resume" : { "loginTokens" : [ { "when" : ISODate("2016-02-16T16:37:54.340Z"), "hashedToken" : "<removed>" } ] }, "ldap" : { "id" : "<removed>", "idAttribute" : "sAMAccountName" } }, "username" : "<removed>", "emails" : [ { "address" : "<removed>", "verified" : false } ], "status" : "online", "active" : true, "roles" : [ "user" ], "ldap" : true, "lastLogin" : ISODate("2016-03-02T15:29:38.105Z"), "statusConnection" : "online", "utcOffset" : 0, "avatarOrigin" : "gravatar", "settings" : { "preferences" : { "disableNewRoomNotification" : true, "disableNewMessageNotification" : true, "useEmojis" : true, "convertAsciiEmoji" : true, "saveMobileBandwidth" : true, "compactView" : true, "unreadRoomsMode" : false, "autoImageLoad" : true, "emailNotificationMode" : "all", "highlights" : [ "" ] } }, "statusDefault" : "online", "name" : "<removed>" }

lochiiconnectivity avatar Mar 02 '16 16:03 lochiiconnectivity

@marceloschmidt: Both

ulope avatar Mar 02 '16 16:03 ulope

This is due to the word highlight. If you enter a word into the word highlight field, this should stop happening.

graywolf336 avatar Mar 02 '16 17:03 graywolf336

@graywolf336: Indeed that seems to "fix" it. Thanks a bunch.

ulope avatar Mar 02 '16 17:03 ulope

agree, fixed for me as well,

lochiiconnectivity avatar Mar 02 '16 17:03 lochiiconnectivity

Also fixed for me! Thanks so much.

royalaid avatar Mar 02 '16 19:03 royalaid

OK, we need to test if the highlight is an empty string and ignore it.

engelgabriel avatar Mar 03 '16 22:03 engelgabriel

It looks like the issue could be in a couple of places:

packages/rocketchat-lib/server/lib/notifyUsersOnMessage.js and packages/rocketchat-lib/server/lib/sendNotificationsOnMessage.js

if (!highlights || highlights.length == 0) { return false; } should be if (!highlights || highlights[0].length == 0) { return false; }

I think that highlights is initialised when a user clicks in the highlight words text area, inserting it in to the user record like this:

    "highlights" : [""]

Another approach could be to clean up if all highlight words are removed.

jamie-owen avatar Mar 04 '16 11:03 jamie-owen

Thank you very much @Jamie-Owen I'll be fixing this right away

marceloschmidt avatar Mar 04 '16 17:03 marceloschmidt

Fixed by 79c64fcf1417eb74c886f4890763f18684b70eb7

marceloschmidt avatar Mar 04 '16 17:03 marceloschmidt