Skip to content

[HOLD for payment 2024-06-06] [$500] Android - Blank screen appears when transitioning between pages after relaunching app #35906

Closed

Description

@lanitochka17

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-37.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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Launch New Expensify app
  2. Kill the app
  3. Relaunch New Expensify app
  4. Open chat with IOU
  5. Tap on the preview to go to report

Expected Result:

There will be no blank page when transitioning between pages

Actual Result:

In Step 4 and 5, there is a blank screen when transitioning between pages

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

Bug6369376_1707228967576.Screen_Recording_20240206_094858_New_Expensify.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01902a14c0b46d4b01
  • Upwork Job ID: 1754876717376974848
  • Last Price Increase: 2024-02-06
  • Automatic offers:
    • ntdiary | Reviewer | 0
    • bernhardoj | Contributor | 0
Issue OwnerCurrent Issue Owner: @kevinksullivan

Activity

  1. added
    External
    Daily
    Bug
    on Feb 6, 2024
  2. changed the title [-] Android - Blank screen appears when transitioning between pages after relaunching app[/-] [+][$500] Android - Blank screen appears when transitioning between pages after relaunching app[/+] on Feb 6, 2024
  3. melvin-bot commented on Feb 6, 2024

    @melvin-bot
  4. added
    Help Wanted
    on Feb 6, 2024
  5. melvin-bot commented on Feb 6, 2024

    @melvin-bot

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

  6. melvin-bot commented on Feb 6, 2024

    @melvin-bot

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

  7. lanitochka17 commented on Feb 6, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #vip-vsp
    CC @quinthar

  8. bernhardoj commented on Feb 6, 2024

    @bernhardoj
    Contributor

    Proposal

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

    A black screen is showing when opening a report screen for the first time.

    What is the root cause of that problem?

    The black screen is because withOnyx returns null while some of the onyx data is unavailable yet and we are loading it.
    https://github.com/Expensify/react-native-onyx/blob/13936aee27bb0cb8c98cb6bf3941044f3d5958ce/lib/withOnyx.js#L315-L317

    The data that are unavailable yet are isComposerFullSize, accountManagerReportID, and userLeavingStatus, but we already set the initialValue for these data, so it should be available immediately.

    isComposerFullSize: {
    key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE}${getReportID(route)}`,
    initialValue: false,
    },

    accountManagerReportID: {
    key: ONYXKEYS.ACCOUNT_MANAGER_REPORT_ID,
    initialValue: null,
    },

    userLeavingStatus: {
    key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT_USER_IS_LEAVING_ROOM}${getReportID(route)}`,
    initialValue: false,
    },

    However, we only set the initial value if the value is truthy and both null and false are not.
    https://github.com/Expensify/react-native-onyx/blob/13936aee27bb0cb8c98cb6bf3941044f3d5958ce/lib/withOnyx.js#L61-L64

    if (!value && mapping.initialValue) {
        value = mapping.initialValue;
    }
    

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

    Update react-native-onyx to apply the initial state if it's not undefined.

    if (!value && mapping.initialValue !== undefined) {
        value = mapping.initialValue;
    }
    

    Notice that the value could be applied to the initial value if the onyx value is falsey, for example, if we have an onyx data that stores a boolean and has a false value, and we set an initial value of 1, then the value will be 1 instead of false. We can apply the same fix by checking whether it's undefined or not.

    We can even simplify the above condition to:

    if (value === undefined) {
        value = mapping.initialValue;
    }
    

    We already guard the undefined value here, so I think we don't need it twice.

  9. ntdiary commented on Feb 8, 2024

    @ntdiary
    Contributor

    Under review.

  10. ntdiary commented on Feb 8, 2024

    @ntdiary
    Contributor

    I think @bernhardoj's proposal makes sense. Additionally, this change will also affect other components, so we need to test them to avoid regressions. :)

    🎀 👀 🎀 C+ reviewed

  11. 40 remaining items

  12. removed
    Reviewing
    on May 30, 2024
  13. melvin-bot commented on May 30, 2024

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  14. melvin-bot commented on May 30, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.77-11 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2024-06-06. 🎊

    For reference, here are some details about the assignees on this issue:

  15. melvin-bot commented on May 30, 2024

    @melvin-bot

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@yuwenmemon] The PR that introduced the bug has been identified. Link to the PR:
    • [@yuwenmemon] 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:
    • [@yuwenmemon] 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:
    • [@ntdiary / @bernhardoj] Determine if we should create a regression test for this bug.
    • [@ntdiary / @bernhardoj] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
    • [@kevinksullivan] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  16. added
    Daily
    and removed
    Weekly
    on Jun 6, 2024
  17. melvin-bot commented on Jun 11, 2024

    @melvin-bot

    @yuwenmemon, @ntdiary, @kevinksullivan, @bernhardoj Huh... This is 4 days overdue. Who can take care of this?

  18. bernhardoj commented on Jun 12, 2024

    @bernhardoj
    Contributor

    This is ready for payment @kevinksullivan

  19. ntdiary commented on Jun 12, 2024

    @ntdiary
    Contributor

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@yuwenmemon] The PR that introduced the bug has been identified. Link to the PR: N/A
    • [@yuwenmemon] 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
    • [@yuwenmemon] 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
    • [@ntdiary / @bernhardoj] Determine if we should create a regression test for this bug. Yes
    • [@ntdiary / @bernhardoj] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again. As below
    • [@kevinksullivan] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

    When the initialValue is not set, our HOC component will display nothing before it finishes loading (i.e., a black screen), and I believe we will replace them with useOnyx hooks in the futureso I marked the PR as N/A.

    Regression Test Proposal

    1. Login with a High Traffic Account.
    2. Kill the app and relaunch it.
    3. Open a report with a lot of chat history.
    4. Verify the chat screen/skeleton is shown instead of blank screen for a brief moment.
  20. kevinksullivan commented on Jun 13, 2024

    @kevinksullivan
    Contributor

    Summary:

  21. kevinksullivan commented on Jun 13, 2024

    @kevinksullivan
    Contributor

    All set - regression test created and paid @bernhardoj

  22. JmillsExpensify commented on Jun 13, 2024

    @JmillsExpensify
    Contributor

    $500 approved for @ntdiary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions