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

Make sure that we reduce the unread message count when we delete an unread message #6746

Merged
merged 2 commits into from
Dec 14, 2021

Conversation

yuwenmemon
Copy link
Contributor

@Julesssss please review
cc @parasharrajat

Details

This will call setLocalLastRead when we see that the message being updated is getting deleted. Also a small change to make a variable name a bit clearer.

Fixed Issues

$ #6472

Tests/QA

  1. From account A, send account B a message. Make sure that Account B is logged in but not viewing the message of accountA
  2. From Account A, delete the message you just sent
  3. From account B, verify that the unread indicator for your app does not show anything

Video:
https://user-images.githubusercontent.com/4741899/145924224-69ac2239-bc67-495c-84db-5b2e8539d62f.mp4


  1. From account A, send account B two messages. Make sure that Account B is logged in but not viewing the messages of accountA
  2. From Account A, delete the first message you just sent
  3. From account B, verify that the unread indicator for your app shows 1

Video:
https://user-images.githubusercontent.com/4741899/145924341-b8f5ea80-1e36-40e5-a832-f1360098e334.mp4


  1. From account A, send account B two messages. Make sure that Account B is logged in but not viewing the messages of accountA
  2. From Account A, delete the second message you just sent
  3. From account B, verify that the unread indicator for your app shows 1

Video:
https://user-images.githubusercontent.com/4741899/145924454-2dc772b3-0dcd-4e90-b759-b1eb6c7dc48e.mp4

@yuwenmemon yuwenmemon requested a review from Julesssss December 14, 2021 02:53
@yuwenmemon yuwenmemon self-assigned this Dec 14, 2021
@yuwenmemon yuwenmemon requested a review from a team as a code owner December 14, 2021 02:53
@MelvinBot MelvinBot requested review from nickmurray47 and removed request for a team December 14, 2021 02:54
Copy link
Contributor

@nickmurray47 nickmurray47 left a comment

Choose a reason for hiding this comment

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

Tests well and lgtm minus one linting change

Comment on lines 543 to 545
if (!message.text) {
setLocalLastRead(reportID, lastReadSequenceNumbers[reportID]);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

is this what the linter is looking for?

Suggested change
if (!message.text) {
setLocalLastRead(reportID, lastReadSequenceNumbers[reportID]);
}
if (message.text) {
return;
}
setLocalLastRead(reportID, lastReadSequenceNumbers[reportID]);

Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

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

I can't see the whole code on GH mobile app 🤭. But this function should be called on live delete pusher event.

I think it is but just to be sure.

Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, actionToMerge);
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, actionToMerge).then(() => {
// If the message is deleted, update the last read in case the deleted message is being counted in the unreadActionCount
if (!message.text) {
Copy link
Member

Choose a reason for hiding this comment

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

You should check html instead of text just to be consistent across app.

@yuwenmemon
Copy link
Contributor Author

Updated!

Copy link
Contributor

@nickmurray47 nickmurray47 left a comment

Choose a reason for hiding this comment

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

nice 👍 will leave this for Jules to final approve/merge

@Julesssss Julesssss merged commit bfaabd9 into main Dec 14, 2021
@Julesssss Julesssss deleted the yuwen-unreadDeleted branch December 14, 2021 10:48
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @Julesssss in version: 1.1.20-3 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @Julesssss in version: 1.1.21-1 🚀

platform result
🤖 android 🤖 failure ❌
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

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.

5 participants