Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2392 - No need to send a notification when the chatroom is open #2394

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

SebinSong
Copy link
Collaborator

closes #2392

It appears the fix works well when tested with multiple containers of Firefox Dev Edition.

@SebinSong SebinSong self-assigned this Oct 27, 2024
Copy link

cypress bot commented Oct 27, 2024

group-income    Run #3351

Run Properties:  status check passed Passed #3351  •  git commit 33dda1cb66 ℹ️: Merge 885e49082269884e516faeae5931de6e8a0b6824 into 1bc76ebde99551c7e9d478bfca90...
Project group-income
Branch Review sebin/task/#2392-dm-notification-issue
Run status status check passed Passed #3351
Run duration 09m 05s
Commit git commit 33dda1cb66 ℹ️: Merge 885e49082269884e516faeae5931de6e8a0b6824 into 1bc76ebde99551c7e9d478bfca90...
Committer Sebin Song
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 10
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 111
View all changes introduced in this branch ↗︎

@SebinSong SebinSong changed the title #2392 - No need to send a notification when the chatroom is open [WIP] #2392 - No need to send a notification when the chatroom is open Oct 27, 2024
@SebinSong SebinSong changed the title [WIP] #2392 - No need to send a notification when the chatroom is open #2392 - No need to send a notification when the chatroom is open Oct 27, 2024
Comment on lines +27 to +29
const currentRoute = sbp('controller/router').history.current || ''
const isTargetChatroomCurrentlyActive = currentRoute.path.includes('/group-chat') &&
getters.currentChatRoomId === contractID // when the target chatroom is currently open/active on the browser, No need to send a notification.
Copy link
Member

@taoeffect taoeffect Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two potential issues we need to consider here:

  1. Should we send a notification anyway when the user is idle but on the page? (We currently use idleVue to check for this, search the project for it)
  2. Are we able to, when using the service worker approach, tell what page we're on in the actions (and whether we're idle or not)? This question is for @corrideat

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to approve this after creating an issue to deal with this in a different manner later.

Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Approving this and to deal with the service-worker and idleVue considerations I created issue #2397 and assigned it to @corrideat!

@taoeffect taoeffect merged commit f8ec52b into master Oct 28, 2024
4 checks passed
@taoeffect taoeffect deleted the sebin/task/#2392-dm-notification-issue branch October 28, 2024 18:13
Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops... I think I approved too quickly.

messageReceivePostEffect is supposed to always be called, because it calls 'gi.actions/identity/kv/addChatRoomUnreadMessage' which is always supposed to be called (as it's not notification related).

SebinSong added a commit that referenced this pull request Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notifications displayed when someone sends you a DM while you have the DM open
2 participants