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

notificationPreferencesPage.notificationPreferences.undefined as notification preference when viewing profile of Hidden user #39770

Closed
1 of 6 tasks
m-natarajan opened this issue Apr 5, 2024 · 5 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Needs Reproduction Reproducible steps needed

Comments

@m-natarajan
Copy link

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:
Reproducible in staging?: Needs reproduction
Reproducible in production?: Needs reproduction
Email or phone of affected tester (no customers): @shawnborton
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @shawnborton
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1712223330642339

Action Performed:

Break down in numbered steps

Expected Result:

Describe what you think should've happened

Actual Result:

Describe what actually happened

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

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

Screenshots/Videos

Add any screenshot/video evidence

CleanShot.2024-04-04.at.11.32.57.mp4

View all open jobs on GitHub

@m-natarajan m-natarajan added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Apr 5, 2024
Copy link

melvin-bot bot commented Apr 5, 2024

Triggered auto assignment to @adelekennedy (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@ahmedGaber93
Copy link
Contributor

ahmedGaber93 commented Apr 6, 2024

Proposal

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

notificationPreferencesPage.notificationPreferences.undefined as notification preference when viewing profile of Hidden user

What is the root cause of that problem?

In some cases report.notificationPreference is undefined, so when translate it, the key notificationPreferencesPage.notificationPreferences.undefined is not found

const notificationPreference = shouldShowNotificationPreference
? translate(`notificationPreferencesPage.notificationPreferences.${report.notificationPreference}` as TranslationPaths)
: '';

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

We need to add undefined check for report.notificationPreference in shouldShowNotificationPreference to prevent displaying notificationPreference when it undefined

// const shouldShowNotificationPreference = !isEmptyObject(report) && !isCurrentUser && report.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN;

const shouldShowNotificationPreference = !isEmptyObject(report) && !!report.notificationPreference && !isCurrentUser && report.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN;

What alternative solutions did you explore? (Optional)

we can set default value to notificationPreference here

// translate(`notificationPreferencesPage.notificationPreferences.${report.notificationPreference}`
translate(`notificationPreferencesPage.notificationPreferences.${report.notificationPreference ?? CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS}`

@bernhardoj
Copy link
Contributor

Same issue as #39677

@adelekennedy
Copy link

closing in favor of 39677

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Needs Reproduction Reproducible steps needed
Projects
None yet
Development

No branches or pull requests

5 participants