Skip to content

Signing out and signing back in re-enables focus mode #59861

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

Open
2 of 18 tasks
m-natarajan opened this issue Apr 8, 2025 · 9 comments
Open
2 of 18 tasks

Signing out and signing back in re-enables focus mode #59861

m-natarajan opened this issue Apr 8, 2025 · 9 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Internal Requires API changes or must be handled by Expensify staff Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Apr 8, 2025

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
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
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: @arosiclair
Slack conversation (hyperlinked to channel name): #Quality

Action Performed:

  1. Log into a decently large account
  2. Switch to Most recent priority mode
  3. Log out
  4. Log back in

Expected Result:

User in Most recent priority mode

Actual Result:

User's preference changed to focus mode and a popup displayed regarding focus mode

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

The screenshot for the issue is in OP

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @arosiclair
@m-natarajan m-natarajan added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Needs Reproduction Reproducible steps needed retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause labels Apr 8, 2025
Copy link

melvin-bot bot commented Apr 8, 2025

Triggered auto assignment to @maddylewis (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.

@MelvinBot
Copy link

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

@maddylewis maddylewis added Monthly KSv2 and removed Daily KSv2 labels Apr 9, 2025
@mallenexpensify mallenexpensify added Daily KSv2 Weekly KSv2 and removed Monthly KSv2 Daily KSv2 labels Apr 14, 2025
@mallenexpensify
Copy link
Contributor

@maddylewis made a Weekly for fear of it getting lost as a Monthly. Were you able to reproduce?
Made LOW for now.

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

Copy link

melvin-bot bot commented Apr 22, 2025

@maddylewis this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@maddylewis
Copy link
Contributor

#59861 (comment)

@arosiclair
Copy link
Contributor

I just reproduced this again by reopening web after being away for a long time (triggering a full reconnect). I think the root of the problem is in this log:

[info] Switching user to optimized focus mode - {"reportCount":103,"isInFocusMode":false} 

This should include the value of hasTriedFocusMode but it doesn't when I experience this bug. I'm pretty sure that's because it's undefined even though that's supposed to be prevented by this logic.

I think there's a subtle bug where closures that are blocked on the isReadyPromise have stale values that are not updated even after the promise is resolved. Instead of using the possibly stale values in tryFocusModeUpdate, I think we should resolve the promise with the current values and use those. I'll draft a PR and test that. cc @marcaaron

@arosiclair arosiclair reopened this Apr 28, 2025
@arosiclair arosiclair self-assigned this Apr 28, 2025
@arosiclair arosiclair added Internal Requires API changes or must be handled by Expensify staff and removed Needs Reproduction Reproducible steps needed retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause labels Apr 28, 2025
@mallenexpensify mallenexpensify moved this from Done to HIGH in [#whatsnext] #quality May 1, 2025
@mallenexpensify
Copy link
Contributor

Experiencing this now, it started when I enabled Hybrid App, which I needed to do in order to access NewDot via the Expensify iOS app. I followed the steps in this SO to do so.

Let me know if I can help here at all, as I find this hella frustrating.

Also.. if we think this is affecting many customers, we can update the status, I just put it at HIGH. (not sure it matters though since it looks like @arosiclair is already working on, thanks for doing so!)

@melvin-bot melvin-bot bot added the Overdue label May 7, 2025
@arosiclair
Copy link
Contributor

Worked on this a bit today. After taking a closer look at the PriorityMode lib, I'm taking a bit different approach where I'll refactor it into a component, PriorityModeController. This way we can just use useOnyx and useEffect to check the app state. That should

  • Solve our stale state problem
  • Remove the need to carefully set promises like we're doing now
  • Consolidate all of the priority mode logic to one place

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. Internal Requires API changes or must be handled by Expensify staff Weekly KSv2
Projects
Status: HIGH
Development

No branches or pull requests

6 participants