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] The preference setting doesn’t work when navigating between chat and settings. #47273

Closed
1 of 6 tasks
m-natarajan opened this issue Aug 12, 2024 · 39 comments
Closed
1 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

Comments

@m-natarajan
Copy link

m-natarajan commented Aug 12, 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.19-2
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: @suneox
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1723478204237729

Action Performed:

  1. Go to setting/preferences
  2. Navigate to chat
  3. Navigate back to setting tab
    (If issue doesn’t occur, try again few times)

Expected Result:

Setting animation should work and user can select option from preference setting.

Actual Result:

Setting animation doesn’t work and user can’t select option from preference setting.

This issue also happen on setting/security setting/about setting/Troubleshoot setting/Save the world

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: Safari
  • MacOS: Desktop

Screenshots/Videos

Screen.Recording.2024-08-12.at.22.44.07.mp4
Recording.3154.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017fa6be05e532f86f
  • Upwork Job ID: 1825658706975919362
  • Last Price Increase: 2024-08-19
  • Automatic offers:
    • suneox | Contributor | 103646524
    • QichenZhu | Contributor | 103646535
Issue OwnerCurrent Issue Owner: @strepanier03
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 12, 2024
Copy link

melvin-bot bot commented Aug 12, 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.

@melvin-bot melvin-bot bot added the Overdue label Aug 15, 2024
Copy link

melvin-bot bot commented Aug 16, 2024

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

@QichenZhu
Copy link
Contributor

QichenZhu commented Aug 17, 2024

Edited by proposal-police: This proposal was edited at 2024-08-17 14:26:34 UTC.

Proposal

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

Pages with animated illustrations become unresponsive after switching to another page and back.

What is the root cause of that problem?

The root cause is similar to #36645 (comment).

When you switch to another page, the animated illustration keeps running in the background, adding tasks to a queue.

When you switch back, the browser has to process these tasks first, making it unresponsive to actions using the same queue, such as opening a right-side modal.

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

Follow @hoangzinh's suggestion. The previous fix didn’t implement it because it wasn’t quite relevant to that issue, but it does resolve this issue.

Moreover, if we can combine useIsFocused and useAppState hooks, I think it would improve performance here.

if (isError || appState.isBackground || !animationFile || !isSplashHidden) {

import {useIsFocused} from '@react-navigation/native';
const isFocused = useIsFocused();
if (isError || !isFocused || appState.isBackground || !animationFile || !isSplashHidden) {

What alternative solutions did you explore? (Optional)

The drawback of the main solution is that the animated illustration disappears when the right-side modal is open. We can address this with the code below.

import {useNavigation} from '@react-navigation/native'
import NAVIGATORS from '@src/NAVIGATORS';
const [isHidden, setIsHidden] = React.useState(false);
const navigation = useNavigation();

React.useEffect(() => {
    const unsubscribe = navigation.addListener('focus', () => {
        setIsHidden(false);
    });
    return unsubscribe;
}, [navigation]);

React.useEffect(() => {
    const unsubscribe = navigation.addListener('blur', () => {
        const state = navigation.getState();
        if (state?.routes?.[state?.index ?? 0]?.name !== NAVIGATORS.RIGHT_MODAL_NAVIGATOR) {
            setIsHidden(true);
        }
    });
    return unsubscribe;
}, [navigation]);

if (isError || isHidden || appState.isBackground || !animationFile || !isSplashHidden) {

@strepanier03
Copy link
Contributor

Confirmed this occurred on v9.0.22-5 after 3 tries.

@melvin-bot melvin-bot bot removed the Overdue label Aug 19, 2024
@strepanier03 strepanier03 added the External Added to denote the issue can be worked on by a contributor label Aug 19, 2024
@melvin-bot melvin-bot bot changed the title The preference setting doesn’t work when navigating between chat and settings. [$250] The preference setting doesn’t work when navigating between chat and settings. Aug 19, 2024
Copy link

melvin-bot bot commented Aug 19, 2024

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

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

melvin-bot bot commented Aug 19, 2024

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

@suneox
Copy link
Contributor

suneox commented Aug 20, 2024

I have raised this issue so I'd like to be a reviewer for this issue

@hungvu193
Copy link
Contributor

Go ahead please @suneox 😄

@hungvu193 hungvu193 removed their assignment Aug 20, 2024
@melvin-bot melvin-bot bot added the Overdue label Aug 22, 2024
@suneox
Copy link
Contributor

suneox commented Aug 23, 2024

@QichenZhu proposal LGTM, We can proceed with the primary solution.

🎀 👀 🎀 C+ reviewed

@strepanier03 Could you please assign me for reviewer? Thank you.

Copy link

melvin-bot bot commented Aug 23, 2024

Triggered auto assignment to @aldo-expensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Overdue label Aug 23, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 23, 2024
Copy link

melvin-bot bot commented Aug 23, 2024

📣 @suneox 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

Copy link

melvin-bot bot commented Aug 23, 2024

📣 @QichenZhu 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@aldo-expensify
Copy link
Contributor

Contributor role: @QichenZhu
C+ role: @suneox

@hungvu193
Copy link
Contributor

@suneox can you please try to test it with #48040 (comment)?

@QichenZhu
Copy link
Contributor

@suneox can you please try to test it with #48040 (comment)?

The animations under the backdrop can still play when a right-side modal is open because it was explicitly enabled in this line. Similarly, we could add logic to src/components/Lottie/index.tsx to allow animations to play in the background in the scenario of #48040.

@QichenZhu
Copy link
Contributor

I think that's better to keep these animations to run on the background or at least when we still can see it through backdrop.

Agree. I think if you can see the animations, we should let them run. Alternatively we could replace the animation with a static frame/illustration... but that kinda feels like the juice wouldn't be worth the squeeze to me.

The problem is that sometimes playing animations in the background causes issues, and sometimes it doesn’t. Previously, when something went wrong, such as in #36645 and this issue, we added logic to src/components/Lottie/index.tsx. Ideally, though, it would be better to handle all these scenarios in a unified way.

@dubielzyk-expensify
Copy link
Contributor

Agree. I think if you can see the animations, we should let them run. Alternatively we could replace the animation with a static frame/illustration... but that kinda feels like the juice wouldn't be worth the squeeze to me.

Agree with @dannymcclain here

@hungvu193
Copy link
Contributor

Btw, #48283 was reverted, so I think that's ok to create another PR to cover both case. @QichenZhu

@suneox
Copy link
Contributor

suneox commented Sep 5, 2024

@QichenZhu I think we should check navigationRef.isReady() before access navigation to resolve regression issue. We're still waiting your update

@suneox
Copy link
Contributor

suneox commented Sep 5, 2024

Btw, #48283 was reverted, so I think that's ok to create another PR to cover both case. @QichenZhu

@hungvu193 The PR for this issue has been reverted on the latest main, and the PR you’re working on is still in draft. So I think we shouldn’t handle issue not ready within the scope of this issue.

@QichenZhu
Copy link
Contributor

@suneox @hungvu193 I agree that it's too early to consider it at this stage, as both #48040 and our new PR #48444 are in progress. After whichever PR is merged first, I think the other side might need to retest if the issue still exists and avoid it if needed.

@hungvu193
Copy link
Contributor

#48040 only updates the UI and we found this bug while testing.

@QichenZhu
Copy link
Contributor

@hungvu193 Yeah, but it's tested with the old PR.

Is there a plan when #48040 will be merged?

If so, @suneox could we hold this on it?

@hungvu193
Copy link
Contributor

I don't think we should hold this issue for it, please go ahead and continue with the PR, but please also fix #47273 (comment)

@suneox
Copy link
Contributor

suneox commented Sep 5, 2024

#48040 only updates the UI and we found this bug while testing.

@hungvu193 Could you please help me confirm if the reference issue doesn't occur on the latest main after revert #48283? Due to i could not find any other places showing the same behavior as the reference issue.
Thank you

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Sep 10, 2024
@suneox
Copy link
Contributor

suneox commented Sep 10, 2024

@hungvu193 I’ve verified the new PR for this issue, and it also resolves #47273 (comment). So we will proceed without holding for your referenced issue

@suneox
Copy link
Contributor

suneox commented Sep 25, 2024

Bugzero Checklist

  • [@suneox] The PR that introduced the bug has been identified. Link to the PR: Enable React concurrent mode #42592
  • [@suneox] 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: N/A: Due to the offending PR is an infrastructure update.
  • [@suneox] 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: N/A
  • [@suneox] Determine if we should create a regression test for this bug. N/A: This issue has fixed the regression caused by the infrastructure update.

@suneox
Copy link
Contributor

suneox commented Sep 25, 2024

@strepanier03 This issue has been deployed to production two weeks ago, and the checklist is completed, so we can proceed with payment for this issue.

@suneox
Copy link
Contributor

suneox commented Oct 7, 2024

@strepanier03 Friendly bump for payment

@QichenZhu
Copy link
Contributor

Gentle bump @strepanier03

@aldo-expensify aldo-expensify added Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 and removed Reviewing Has a PR in review Weekly KSv2 labels Oct 21, 2024
@strepanier03
Copy link
Contributor

Sorry for missing this one, the automation to update the title helps so much and when it fails 🤦‍♀️ it makes it tough. Handling this now.

@strepanier03 strepanier03 changed the title [$250] The preference setting doesn’t work when navigating between chat and settings. [PAID] [$250] The preference setting doesn’t work when navigating between chat and settings. Oct 21, 2024
@strepanier03
Copy link
Contributor

This is paid and contracts closed. Sorry again.

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
Projects
None yet
Development

No branches or pull requests

8 participants