hamsket icon indicating copy to clipboard operation
hamsket copied to clipboard

Slack unread counter only works when that's the active tab

Open mcarlton00 opened this issue 5 years ago • 19 comments

Steps to reproduce

  1. Have multiple chat services enrolled (at least 1 is Slack)
  2. Have any other tab active
  3. Receive message in Slack

Expected behavior

Hamsket should notify you there is an unread message on the Slack tab

Actual behavior

Hamsket does not give a visual notification until you switch into that Slack tab.

It does send desktop notifications without error, but then doesn't visually reflect those within Hamsket. This occurs both with general unread channel messages and direct mentions/DMs. No red dot or numerical counter appears until you switch to that tab. If you switch off to a different tab without looking at the unread channel(s), then the notification dot stays active as expected.

ENVIRONMENT

Hamsket: 0.6.0

OS: Arch Linux

Arch: x64 or ia32

BuildVersion: cc3398f (HEAD -> master, tag: nightly, origin/master, origin/HEAD) Mon, 5 Aug 2019 13:13:15 -0700

(Installed via hamsket-git from the Aur

Does this happen upstream: yes, no, unknown, or N/A unknown

mcarlton00 avatar Aug 28 '19 17:08 mcarlton00

I can also confirm this. This not working means we have no idea when a message has arrived so will need to check each slack channel manaully every so often. A vital issue that needs fixing. I am using the latest version, 0.6.0

If this could be looked into, we would all be very thankful!

JamesObZ avatar Sep 11 '19 09:09 JamesObZ

I missed this one for a while.

Are you both on Linux? I've been using slack normally (with icons) all this time, haven't seen any issues.

Slack notification preferences allow the notifications, Do Not Disturb/etc are off?

I get red dot for unread messages always, counter for mentions or DMs (as configured).

There's something happening with you two that's not happening with me, and I just reinstalled my slack services fresh recently (within the last two weeks).

TheGoddessInari avatar Sep 11 '19 16:09 TheGoddessInari

I am using Windows 10 (x64). 'Slack notification preferences allow the notifications, Do Not Disturb/etc are off?' Can confirm notifications are allowed and having previosuly used Rambox CE up until a few days ago this was working. Since moving over to try Hamsket this has not worked for me at all.

Not sure if that helps to compare code differences?

JamesObZ avatar Sep 11 '19 20:09 JamesObZ

Forgot to mention I only had issues after moving to the new renamed package. Previously I was on the rambox-os-git package in the Aur. Build version 844bc8. Says it was built June 20, 2019. That's still running on a second computer and notifications are fine. Also interesting to note that it's only slack that has a problem. Telegram, Riot, Mattermost, and a custom entry for Android Messages all work as expected. Not sure if that helps narrow things down at all.

mcarlton00 avatar Sep 12 '19 13:09 mcarlton00

That makes little sense as the ServicesList, which contains all of the js_unread code, hasn't been updated since before June 20th.

I'll look over things later today, but there haven't been any updates since then that would directly affect Slack's notifications. The js_unread is fundamentally the same as Rambox CE. IIRC they removed jQuery after we did, and it hasn't changed since April. Just electron updates, and a fix for the icon loader (totally unrelated code).

TheGoddessInari avatar Sep 12 '19 15:09 TheGoddessInari

Finally seeing this behavior, but what's strange is that the code/selectors/classes for the unread code hasn't changed on Slack's end.

Everything else (old versions, CE, Franz, etc) are using the same-ish code here.

TheGoddessInari avatar Sep 15 '19 15:09 TheGoddessInari

Unfortuantely i canot offer any assistance when it comes to what could be causing this as i am not a developer. But having had a play around and to confirm my initial response. Ii have installed both Rambox CE and Hamsket side-by-side with the same accounts logged in. Rambox CE recieves the Slack notification (unread badge counter appears) where as Hamsket does not show this.

JamesObZ avatar Sep 16 '19 10:09 JamesObZ

Since it does show up once you click into a Slack pane, could it be some sort of backend priority or race condition for displaying the unread counter? Or would it make sense to have the function that calls the desktop notifications also add to the unread counter? (not a JS coder, so I don't actually know how it works internally. just throwing out potential ideas)

mcarlton00 avatar Sep 16 '19 14:09 mcarlton00

Does it work correctly in yesterday's Rambox-OS 0.5.19 compared to the Hamsket nightly? If so, it's 99% chance it's some sort of electron bug, then, as at this point, that's the main change between the two since I had to do a stable release for people still holding onto that.

TheGoddessInari avatar Sep 16 '19 16:09 TheGoddessInari

Yes, it appears to work correctly in Rambox 0.5.19

mcarlton00 avatar Sep 17 '19 13:09 mcarlton00

Just to state the obvious, I must be missing something as 0.5.19 includes 0fd4a98, which uses identical code as rambox master to determine the unread count.

I guess I'll try to make multiple accounts and just ping myself (not ideal).

TheGoddessInari avatar Oct 10 '19 15:10 TheGoddessInari

I've tracked it down to https://github.com/TheGoddessInari/hamsket/commit/581f258d759103b7c1b5833d304b07734d559028.

  1. git checkout $commit
  2. npm install && npm start
  3. Send a message to slackbot in another window and switch tabs before it responds.

Not sure about general channel messages, but that commit is when direct messages stopped registering. I'm going to assume that it's the same underlying problem for both types of notifications.

mcarlton00 avatar Oct 10 '19 17:10 mcarlton00

This still doesn't occur with 0.5.20, right? I can't imagine what would happen with electron to affect the notifications for a specific service.

TheGoddessInari avatar Oct 21 '19 14:10 TheGoddessInari

It appears to be fixed in 0.5.20, yes. Are we fixed, or do you want to do more investigation?

mcarlton00 avatar Oct 22 '19 17:10 mcarlton00

This looks like it's been fixed with 0.5.20 and master for quite some time so closing. Comment if needed.

TheGoddessInari avatar Dec 10 '19 10:12 TheGoddessInari

The last time I tested this (702230e8b4e9ae2bd8b04eca7a7da764de6b212a), it wasn't working for me. The slack counter only updated, when I opened the tab. I have two tabs running slack and both have the issues.
I tested rambox master (with some patches) and there I don't have this issue, since there are a lot of changes in the core, it's hard to figure out the differences...

ThauEx avatar Dec 10 '19 10:12 ThauEx

I can see no notifications for background slack services for latest nightly: Version: 0.6.0 Platform: linux (x64) Electron: 8.2.3 Chromium: 80.0.3987.163 Node: 12.13.0 BuildVersion: d78a4ea (grafted, HEAD, tag: nightly, origin/master) Sat, 2 May 2020 16:38:47 -0700

Running on Ubuntu 20.04.

tekaeren avatar May 08 '20 10:05 tekaeren

I have the same issue for the latest nightly. Version: 0.6.0 Platform: linux (x64) Electron: 9.1.2 Chromium: 83.0.4103.122 Node: 12.14.1 BuildVersion: 9ab646e (grafted, HEAD, tag: nightly, origin/master) Mon, 3 Aug 2020 08:19:02 -0700

beltrame avatar Aug 11 '20 16:08 beltrame

I'm still seeing this behavior with a recent nightly: Version: 0.6.3 Platform: darwin (x64) Electron: 13.5.1 Chromium: 91.0.4472.164 Node: 14.16.0 BuildVersion: d86d4ef (grafted, HEAD, tag: nightly, origin/d86d4ef90e9f2a32a8075db438437e32c34b17a5) Fri, 12 Nov 2021 21:13:57 -0800

sethcooper avatar Nov 15 '21 16:11 sethcooper