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

[$250] Android - Profile - Domains and Help buttons remain highlighted after navigating back #52211

Open
2 of 8 tasks
lanitochka17 opened this issue Nov 7, 2024 · 37 comments
Open
2 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 7, 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.59-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open the Expensify app
  2. Tap on "Settings" on the bottom of the screen
  3. Tap on "Help"
  4. Use device back button to navigate back
  5. Verify "Help" button is not highlighted anymore
  6. Tap on "Domains" button
  7. Navigate back with device back button
  8. Verify "Domains" button is not highlighted anymore

Expected Result:

"Domains" and "Help" button shouldn´t remain selected after navigating back to app

Actual Result:

After tapping on "Domains" or "Help" buttons and navigating back with device back button, the buttons remain highlighted

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6657941_1731003473938.Domains.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021854637211818328663
  • Upwork Job ID: 1854637211818328663
  • Last Price Increase: 2024-12-12
Issue OwnerCurrent Issue Owner: @parasharrajat
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 7, 2024
Copy link

melvin-bot bot commented Nov 7, 2024

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

@isabelastisser isabelastisser added External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Nov 7, 2024
@melvin-bot melvin-bot bot changed the title Android - Profile - Domains and Help buttons remain highlighted after navigating back [$250] Android - Profile - Domains and Help buttons remain highlighted after navigating back Nov 7, 2024
Copy link

melvin-bot bot commented Nov 7, 2024

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

Copy link

melvin-bot bot commented Nov 7, 2024

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

@truph01
Copy link
Contributor

truph01 commented Nov 7, 2024

Edited by proposal-police: This proposal was edited at 2024-11-07 22:21:35 UTC.

Proposal

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

After tapping on "Domains" or "Help" buttons and navigating back with device back button, the buttons remain highlighted

What is the root cause of that problem?

  • When pressing the "Help" button, the icon fills with green to indicate it’s active. This button navigates the user to an external browser, changing appState.isBackground to true. Upon returning to the app, appState.isForeground is set back to true. However, a logic check here uses a cached image instead of loading a new one:

cachePolicy="memory"

This results in the icon button remaining highlighted after navigating back.

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

  • We can clear the cache data one the appState.isBackground is true in this:
    const {isBackground} = useAppState();
    useEffect(() => {
        if (isBackground) {
            Image.clearMemoryCache();
        }
    }, [isBackground]);

What alternative solutions did you explore? (Optional)

  • We can create a logic using your appState hook to switch the cachePolicy to "none" when the app comes back to the foreground, ensuring it reloads icons and images without caching. Once reloaded, you can set it back to "memory" to use cached images as it is. Here’s a general approach:
    const [cachePolicy, setCachePolicy] = useState('memory');
    const {isForeground} = useAppState();
    const prevIsForeground = usePrevious(isForeground);
    useEffect(() => {
        if (isForeground && !prevIsForeground) {
            // Set cachePolicy to 'none' temporarily when returning to foreground
            setCachePolicy('none');
            // Reset to 'memory' after a slight delay to allow re-render with fresh images
            setTimeout(() => setCachePolicy('memory'), 500);
        }
    }, [isForeground, isForeground]);
  • Instead of resetting the cachePolicy to 'memory' by using setTimeout, we can do it in:

        <Image
            onLoad={() => {
                // Reset to 'memory'
                setCachePolicy('memory');
            }}

@truph01
Copy link
Contributor

truph01 commented Nov 7, 2024

Proposal updated

@parasharrajat
Copy link
Member

Let see if we get more ideas to solve this issue.

Copy link

melvin-bot bot commented Nov 12, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Nov 12, 2024
@isabelastisser
Copy link
Contributor

Waiting for more proposals.

@parasharrajat
Copy link
Member

parasharrajat commented Nov 12, 2024

Yup. waiting for more proposals.

@melvin-bot melvin-bot bot removed the Overdue label Nov 12, 2024
Copy link

melvin-bot bot commented Nov 14, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Nov 18, 2024

@parasharrajat, @isabelastisser Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot added the Overdue label Nov 18, 2024
@truph01
Copy link
Contributor

truph01 commented Nov 18, 2024

@parasharrajat What do you think about my proposal?

Copy link

melvin-bot bot commented Nov 20, 2024

@parasharrajat, @isabelastisser 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@parasharrajat
Copy link
Member

No new proposals. @truph01 I will share feedback on your proposal in sometime.

@melvin-bot melvin-bot bot removed the Overdue label Nov 20, 2024
Copy link

melvin-bot bot commented Nov 21, 2024

@parasharrajat @isabelastisser this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Nov 21, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@parasharrajat
Copy link
Member

@truph01 What will happen if we background the app after opening the attachment menu on receipt following steps from this issue #34881. Won't it recreate that issue again with your solution?

Copy link

melvin-bot bot commented Nov 26, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Nov 26, 2024
@truph01
Copy link
Contributor

truph01 commented Nov 26, 2024

I will check it today

Copy link

melvin-bot bot commented Nov 28, 2024

@parasharrajat, @isabelastisser Huh... This is 4 days overdue. Who can take care of this?

Copy link

melvin-bot bot commented Nov 28, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@parasharrajat
Copy link
Member

Any update @truph01?

@melvin-bot melvin-bot bot removed the Overdue label Dec 1, 2024
@truph01
Copy link
Contributor

truph01 commented Dec 2, 2024

@parasharrajat I am unable to reproduce the bug in #34881 even when I tried to revert the change in PR. So I need more time to test and re-investigate that issue and this one.

@isabelastisser
Copy link
Contributor

@parasharrajat, should we close this?

Copy link

melvin-bot bot commented Dec 5, 2024

@parasharrajat @isabelastisser this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@melvin-bot melvin-bot bot added the Overdue label Dec 5, 2024
Copy link

melvin-bot bot commented Dec 5, 2024

@parasharrajat, @isabelastisser Whoops! This issue is 2 days overdue. Let's get this updated quick!

@parasharrajat
Copy link
Member

I can still reproduce this issue on the latest main. @truph01 Can you try again?

@melvin-bot melvin-bot bot removed the Overdue label Dec 5, 2024
Copy link

melvin-bot bot commented Dec 5, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Dec 9, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Dec 9, 2024
@truph01
Copy link
Contributor

truph01 commented Dec 9, 2024

Can you try again

Yes. I can reproduce. I need to investigate the RCA of the issue again

@isabelastisser
Copy link
Contributor

@parasharrajat, please provide an update; thanks!

@parasharrajat
Copy link
Member

@isabelastisser No, I can still reproduce this issue.

@melvin-bot melvin-bot bot removed the Overdue label Dec 9, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Dec 12, 2024
@isabelastisser
Copy link
Contributor

Still waiting for proposals.

Copy link

melvin-bot bot commented Dec 13, 2024

@parasharrajat, @isabelastisser Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Dec 17, 2024

@parasharrajat, @isabelastisser Still overdue 6 days?! Let's take care of this!

@parasharrajat
Copy link
Member

Need proposals.

@melvin-bot melvin-bot bot removed the Overdue label Dec 17, 2024
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 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

4 participants