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

Refactor the API for saving the report notification preferences #9501

Merged
merged 10 commits into from
Jul 6, 2022

Conversation

tgolen
Copy link
Contributor

@tgolen tgolen commented Jun 20, 2022

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/211600

Tests

  1. Open an #announce workspace chate
  2. Click on the chat header to go to the details
  3. Go to the settings
  4. Change the notification preferences
  5. Refresh/reload the app to ensure the setting stuck
  • Verify that no errors appear in the JS console

QA Steps

Same as above

  • Verify that no errors appear in the JS console

Screenshots

Web

2022-06-20_15-34-43.mp4

Adding in a video to show pusher working to update multiple connected clients

2022-06-22_10-31-22.mp4

Mobile Web

2022-06-20_15-35-09.mp4

Desktop

2022-06-20_15-37-10.mp4

iOS

2022-06-20_15-45-14.mp4

Android

2022-06-20_15-40-35.mp4

@tgolen tgolen requested review from marcaaron and a team as code owners June 20, 2022 21:49
@tgolen tgolen self-assigned this Jun 20, 2022
@melvin-bot melvin-bot bot requested review from roryabraham and removed request for a team June 20, 2022 22:33
@melvin-bot
Copy link

melvin-bot bot commented Jun 20, 2022

Looks like you modified deprecatedAPI.js! To be clear, you should not be adding any code to this file.

Instead, all new API commands should use API.js, and follow our guidelines for writing new API commands.

Unsure if your change is okay? Drop a note in #expensify-open-source!

@tgolen
Copy link
Contributor Author

tgolen commented Jun 21, 2022

Updated with failure data. Still waiting to make the CONST change

@tgolen
Copy link
Contributor Author

tgolen commented Jun 21, 2022

Update with CONST update

marcaaron
marcaaron previously approved these changes Jun 21, 2022
@tgolen tgolen changed the title [HOLD Web-E PR #34059] Refactor the API for saving the report notification preferences [HOLD Web-E PR #34076] Refactor the API for saving the report notification preferences Jun 22, 2022
@tgolen
Copy link
Contributor Author

tgolen commented Jun 22, 2022

I made an update to web-e so that the pusher response would be sent out to all clients. It didn't result in any updates to this branch though.

@tgolen tgolen changed the title [HOLD Web-E PR #34076] Refactor the API for saving the report notification preferences Refactor the API for saving the report notification preferences Jul 4, 2022
@tgolen
Copy link
Contributor Author

tgolen commented Jul 4, 2022

Hold is removed and this is ready to be merged now.

function updateNotificationPreference(reportID, notificationPreference) {
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {notificationPreference});
DeprecatedAPI.Report_UpdateNotificationPreference({reportID, notificationPreference});
function updateNotificationPreference(reportID, previousValue, newValue) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we are missing JSDocs for this.

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

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

Except for the missing JSDoc LGTM 👍

@tgolen
Copy link
Contributor Author

tgolen commented Jul 5, 2022

Added JS docs 👍

Co-authored-by: Rory Abraham <47436092+roryabraham@users.noreply.github.com>
@tgolen
Copy link
Contributor Author

tgolen commented Jul 6, 2022

updated @roryabraham

@marcaaron marcaaron merged commit 81012a3 into main Jul 6, 2022
@marcaaron marcaaron deleted the tgolen-report-notifications branch July 6, 2022 16:18
@OSBotify
Copy link
Contributor

OSBotify commented Jul 6, 2022

✋ 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

OSBotify commented Jul 8, 2022

🚀 Deployed to staging by @marcaaron in version: 1.1.81-0 🚀

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

@marcochavezf
Copy link
Contributor

marcochavezf commented Jul 11, 2022

Hi guys, QA reported this issue related to the notification preferences #9805, it can't be reproduced consistently but happens when I change the notification preferences and refresh the browser quickly. Thoughts about this issue? @tgolen @marcaaron @roryabraham

@marcaaron
Copy link
Contributor

Explained in this comment -> #9805 (comment)

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @roryabraham in version: 1.1.82-5 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 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