App: [$500] `Switch to focus mode` modal appears every time sign out and sign in for same account

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.46-0 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @iwiznia Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1709229575556299

Action Performed:

  1. Have an account with many chats
  2. Have your message Priority mode setting set tomost recent mode
  3. Sign out and sign back in
  4. See the “switch to focus mode” modal is shown and you are switched to focus mode
  5. Switch your message Priority mode setting tomost recent mode
  6. Sign out and sign back in

Expected Result:

The account’s message Priority mode should not be switched to #focus mode, nor should the #focus mode modal appear since the account should not be in #focus mode.

Actual Result:

The switch to focus mode modal is shown and you are switched to focus mode

Workaround:

unknown

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

https://github.com/Expensify/App/assets/38435837/c33a9f67-06bd-415b-a56a-f9155dafb64b

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f91501e19c2b41b5
  • Upwork Job ID: 1765136631800881152
  • Last Price Increase: 2024-03-05
  • Automatic offers:
    • ishpaul777 | Reviewer | 0
    • bernhardoj | Contributor | 0

About this issue

  • Original URL
  • State: open
  • Created 4 months ago
  • Comments: 24 (15 by maintainers)

Most upvoted comments

PR is ready

cc: @ishpaul777

Hi @johncschuster! This issue was assigned to me after I went OoO last night, so reassigning. Thanks!

Proposal

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

Switch to focus mode modal appears every time sign out and sign in for same account

What is the root cause of that problem?

We don’t update NVP_TRY_FOCUS_MODE Onyx value, instead we just assign it to a varibale. https://github.com/Expensify/App/blob/48657b48505e40fecc7c6f43da903aadb12d549a/src/libs/actions/PriorityMode.ts#L146-L147

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

We need to update it to Onyx.merge(ONYXKEYS.NVP_TRY_FOCUS_MODE, true);.

Result