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

[PAID] [$250] Room - After rejoining room, notification settings changed to immediately #48694

Closed
3 of 6 tasks
IuliiaHerets opened this issue Sep 6, 2024 · 50 comments
Closed
3 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Monthly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 6, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.30-7
Reproducible in staging?: Y
Reproducible in production?: Y
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Via fab, create a room
  3. Tap header -- settings
  4. Note notifications is set "daily"
  5. Tap leave and now tap header -- settings
  6. Now note notifications field missing
  7. Now send a message and join the room
  8. Tap header--settings

Expected Result:

After rejoining room, notification settings must not change to immediately.

Actual Result:

After rejoining room, notification settings changed to immediately.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6594781_1725582608988.on.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021833657980074790757
  • Upwork Job ID: 1833657980074790757
  • Last Price Increase: 2024-10-02
  • Automatic offers:
    • shubham1206agra | Contributor | 104297840
Issue OwnerCurrent Issue Owner: @strepanier03
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 6, 2024
Copy link

melvin-bot bot commented Sep 6, 2024

Triggered auto assignment to @strepanier03 (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@IuliiaHerets
Copy link
Author

@strepanier03 FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@Nodebrute
Copy link
Contributor

Nodebrute commented Sep 6, 2024

Edited by proposal-police: This proposal was edited at 2023-10-03T13:22:17Z.

Proposal

Please re-state the problem that we are trying to solve in this issue.

After rejoining room, notification settings changed to immediately

What is the root cause of that problem?

When we leave room we set the notification preference to "hidden" and when we join room by adding comment we set the notification preference to "always"

What changes do you think we should make in order to solve the problem?

We should update this to daily because when we create room the notification preference is daily CONST.REPORT.NOTIFICATION_PREFERENCE.DAILY

optimisticReport.notificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS;

We need to change this in joinroom too. We can also fix this in other places.

What alternative solutions did you explore? (Optional)

@dominictb
Copy link
Contributor

dominictb commented Sep 8, 2024

Edited by proposal-police: This proposal was edited at {current_timestamp}.

Proposal

Please re-state the problem that we are trying to solve in this issue.

  • After rejoining room, notification settings changed to immediately.

What is the root cause of that problem?

What changes do you think we should make in order to solve the problem?

        optimisticReport.notificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS;
        if (ReportUtils.isUserCreatedPolicyRoom(report)) {
            optimisticReport.notificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.DAILY;
        }

and the same should be applied to:

notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Sep 9, 2024
Copy link

melvin-bot bot commented Sep 9, 2024

@strepanier03 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@strepanier03 strepanier03 added the External Added to denote the issue can be worked on by a contributor label Sep 11, 2024
@melvin-bot melvin-bot bot changed the title Room - After rejoining room, notification settings changed to immediately [$250] Room - After rejoining room, notification settings changed to immediately Sep 11, 2024
Copy link

melvin-bot bot commented Sep 11, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021833657980074790757

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 11, 2024
Copy link

melvin-bot bot commented Sep 11, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (External)

Copy link

melvin-bot bot commented Sep 16, 2024

@strepanier03, @fedirjh Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot added the Overdue label Sep 16, 2024
Copy link

melvin-bot bot commented Sep 18, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Sep 18, 2024

@strepanier03, @fedirjh Still overdue 6 days?! Let's take care of this!

@fedirjh
Copy link
Contributor

fedirjh commented Sep 18, 2024

After rejoining room, notification settings must not change to immediately.

cc @strepanier03 @IuliiaHerets What is the expected result? Should this be set to daily?

@melvin-bot melvin-bot bot removed the Overdue label Sep 18, 2024
@fedirjh
Copy link
Contributor

fedirjh commented Sep 18, 2024

@Nodebrute @dominictb I checked the AddComment command and it seems that the backend returns the correct data, why doesn’t this onyx update be applied ? seems like there is a bug with Onyx ?

Screenshot 2024-09-18 at 11 10 02 PM

@dominictb
Copy link
Contributor

seems like there is a bug with Onyx

yes, I think so. But I cannot find the RCA.

Copy link

melvin-bot bot commented Sep 20, 2024

@strepanier03 @fedirjh this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@shubham1206agra
Copy link
Contributor

@puneetlath I think you need to check this.

@melvin-bot melvin-bot bot added the Overdue label Sep 23, 2024
@wildan-m
Copy link
Contributor

wildan-m commented Sep 24, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Upon reentering the room, notification settings were changed to immediate.

What is the root cause of that problem?

We are always override the notification to ALWAYS when report not empty and current notification preference is hidden

if (shouldUpdateNotificationPrefernece) {
// optimisticReport.notificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS;
successData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: {
participants: {
[currentUserAccountID]: {notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS},
},
},
});
}

What changes do you think we should make in order to solve the problem?

The change is intended to fix the issue of chats disappearing when creating a chat with an unknown user while offline.

#47450

When the PR was created, the addComment API did not return notificationPreference, so the PR attempted to fill it from the front end. This is detailed in the author's alternative proposal. #44829 (comment)

The addComment API now includes notification preference from the backend. We can revert the unnecessary changes in the PR, particularly the ones related to successData.

if (shouldUpdateNotificationPrefernece) {
// optimisticReport.notificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS;
successData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: {
participants: {
[currentUserAccountID]: {notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS},
},
},
});
}

I've noticed that join room intentionally makes the notification to ALWAYS, if that's not intentional we can also adjust that as well to make notification preferences based on BE response

App/src/libs/actions/Report.ts

Lines 2753 to 2766 in 1c39bd2

function joinRoom(report: OnyxEntry<Report>) {
if (!report) {
return;
}
updateNotificationPreference(
report.reportID,
ReportUtils.getReportNotificationPreference(report),
CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,
false,
report.parentReportID,
report.parentReportActionID,
report,
);
}

What alternative solutions did you explore? (Optional)

N/A

@wildan-m
Copy link
Contributor

Proposal Updated

  • mention joinRoom adjustment if required

@melvin-bot melvin-bot bot added the Weekly KSv2 label Oct 14, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 18, 2024
@melvin-bot melvin-bot bot changed the title [$250] Room - After rejoining room, notification settings changed to immediately [HOLD for payment 2024-10-25] [$250] Room - After rejoining room, notification settings changed to immediately Oct 18, 2024
Copy link

melvin-bot bot commented Oct 18, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 18, 2024
Copy link

melvin-bot bot commented Oct 18, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.50-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-10-25. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Oct 18, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@fedirjh / @shubham1206agra] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh / @shubham1206agra] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@fedirjh / @shubham1206agra] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@fedirjh / @shubham1206agra] Determine if we should create a regression test for this bug.
  • [@fedirjh / @shubham1206agra] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@strepanier03] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@strepanier03 strepanier03 added Daily KSv2 and removed Weekly KSv2 labels Oct 25, 2024
@melvin-bot melvin-bot bot added Daily KSv2 Monthly KSv2 and removed Daily KSv2 labels Oct 25, 2024
@strepanier03
Copy link
Contributor

@shubham1206agra @fedirjh - I'm going to be off for the day very soon but I'll check in this weekend to see if the checklist is complete. Once it is I'll do that payment summary.

@melvin-bot melvin-bot bot added the Overdue label Oct 28, 2024
@lakchote
Copy link
Contributor

@shubham1206agra @fedirjh please complete the checklist, thanks!

@shubham1206agra
Copy link
Contributor

@fedirjh needs to complete the checklist.

@fedirjh
Copy link
Contributor

fedirjh commented Oct 28, 2024

BugZero Checklist:


Regression Test Proposal

1. Open App
2. Create new room & navigate to it
3. Tap header -> settings
4. Verify notifications is set "daily"
5. Tap leave and now tap header -> settings
6. Verify notifications field missing
7. Send a message and join the room
8. Tap header -> settings
9. Verify that notifications is set "daily"
  • Do we agree 👍 or 👎

@strepanier03
Copy link
Contributor

strepanier03 commented Oct 28, 2024

Payment Summary

@melvin-bot melvin-bot bot removed the Overdue label Oct 28, 2024
@strepanier03
Copy link
Contributor

@shubham1206agra I'll check back in later today to see if you accepted the offer in Upwork.

@fedirjh - please feel free to request payment in New Expensify. I see your checklist responses and have created the reg test GH.

@shubham1206agra
Copy link
Contributor

@strepanier03 Offer accepted

@strepanier03
Copy link
Contributor

All right, I paid out the UPwork job, thanks for accepting @shubham1206agra.

All that let's is @fedirjh to request in New Expensify so I'm closing this GH as completed.

Copy link

melvin-bot bot commented Oct 29, 2024

@strepanier03 @lakchote Be sure to fill out the Contact List!

@strepanier03 strepanier03 changed the title [HOLD for payment 2024-10-25] [$250] Room - After rejoining room, notification settings changed to immediately [PAID] [$250] Room - After rejoining room, notification settings changed to immediately Oct 29, 2024
@garrettmknight
Copy link
Contributor

$250 approved for @fedirjh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Monthly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants