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

[HOLD for payment 2025-01-28] [$250] Android - Create Chat - "You appear to be offline" is displayed floating on room creation #54157

Open
2 of 8 tasks
IuliiaHerets opened this issue Dec 14, 2024 · 42 comments
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

@IuliiaHerets
Copy link

IuliiaHerets commented Dec 14, 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.76-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5347500&group_by=cases:section_id&group_order=asc&group_id=229067
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 - Android 12
App Component: Other

Action Performed:

  1. Open the Expensify app.
  2. Turn off internet connection.
  3. Tap on FAB and select "Start Chat"
  4. Tap on "Room"
  5. Tap on the arrow on the top left corner.
  6. Tap on FAB again.
  7. Wait for the keyboard to open.
  8. Tap on "Visibility"

Expected Result:

"You appear to be offline" message should be displayed at the bottom of the screen.

Actual Result:

"You appear to be offline" message is displayed floating almost in the middle of the screen, when entering "Visibility" section while creating a room.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/user-attachments/assets/5507802e-b409-49e6-ab61-78a700e78efa
Screenshot_20241214-143227

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021869013333360050012
  • Upwork Job ID: 1869013333360050012
  • Last Price Increase: 2024-12-17
  • Automatic offers:
    • DylanDylann | Reviewer | 105630023
    • truph01 | Contributor | 105630026
Issue OwnerCurrent Issue Owner: @greg-schroeder
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 14, 2024
Copy link

melvin-bot bot commented Dec 14, 2024

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

@abzokhattab
Copy link
Contributor

abzokhattab commented Dec 14, 2024

Edited by proposal-police: This proposal was edited at 2024-12-14 15:07:21 UTC.

Proposal

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

When creating a chat, the message "You appear to be offline" is displayed floating during room creation.

What is the root cause of that problem?

  • The component ValuePicker is used inside the WorkspaceNewRoomPage to display the visibility list.
  • When clicking on it, it shows the ValueSelectorModal.
  • There is an issue in the ScreenWrapper styles within the ValueSelectorModal, where keyboardAvoidingView is enabled by default. This causes the indicator to appear in the middle of the screen after opening the modal while the keyboard is open on the previous page.
  • the issue specifically occurs because the navigation goes to the visibility page before the keyboard is closed making the keyboardAvoidingView place the indicator in the middle as if the keyboard is opened

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

We should set shouldEnableKeyboardAvoidingView={false} here since the keyboard is not used in this component:

<ScreenWrapper
style={styles.pb0}
includePaddingTop={false}
includeSafeAreaPaddingBottom
testID={ValueSelectorModal.displayName}
>
<HeaderWithBackButton

POC

image

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

What alternative solutions did you explore? (Optional)

Another solution is to disable the KeyboardAvoidingView inside the ScreenWrapper here if the isKeyboardShown is false:

                        enabled={shouldEnableKeyboardAvoidingView && isKeyboardShown}

@truph01
Copy link
Contributor

truph01 commented Dec 14, 2024

Edited by proposal-police: This proposal was edited at 2024-12-14 15:58:14 UTC.

Proposal

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

  • "You appear to be offline" message is displayed floating almost in the middle of the screen, when entering "Visibility" section while creating a room.

What is the root cause of that problem?

  • The issue appears when we are on room page, open the keyboard and then open another screen/modal. And, it is only countered in android.

  • We are using keyboard avoiding view in value picker modal, which will automatically adjust the screen height when there is the keyboard. And this issue appears because of KeyboardAvoidingView/index.android.tsx.

  • The original bug/problem comes from the fact, that useKeyboardHandler in that file is attaching handlers asynchronously (it's attaching it on UI thread) and there could be a situation, when we start to mount a handler while keyboard is visible, then keyboard gets closed and we couldn't register a handler yet. In this case we'll have a bug that described in the issue - we see a keyboard space even if keyboard is already closed. As a result, the offline indicator is displayed floating on room creation.

  • Note: We migrated to use the "react-native-keyboard-controller" directly in PR, but the logic is not changed.

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

            <ScreenWrapper
                shouldEnableKeyboardAvoidingView={shouldEnableKeyboardAvoidingView}
  • Similar with ValuePicker, we also need to create a param shouldEnableKeyboardAvoidingView and default value is true.

  • Then update:

<ValueSelectorModal

            <ValueSelectorModal
                shouldEnableKeyboardAvoidingView={shouldEnableKeyboardAvoidingView}
  • Finally, when use the ValuePicker component in here, here and here, pass shouldEnableKeyboardAvoidingView={false}.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

  • To make sure the useKeyboardHandler is not in the case "when we start to mount a handler while keyboard is visible, then keyboard gets closed and we couldn't register a handler yet", we can add a short delay time here, 300ms for example.

@abzokhattab
Copy link
Contributor

Proposal updated

Added an alternative solution

@truph01
Copy link
Contributor

truph01 commented Dec 14, 2024

Proposal updated

@abzokhattab
Copy link
Contributor

Seems like this issue #53327 fixed the current issue as well, however there is a problem i notice .. the navigation feels abit heavy (laggy) after this change

i think we shouldnt wait for the keyboard to be closed, we should just disable the KeyboardAvoidingView in that component

Screen.Recording.2024-12-14.at.18.11.39.mov

@truph01
Copy link
Contributor

truph01 commented Dec 14, 2024

Yeah, I think it should be fixed in #53893 (comment) since it has just been merged for 13 hours. Asked the PR author to check.

@melvin-bot melvin-bot bot added the Overdue label Dec 17, 2024
@greg-schroeder greg-schroeder added the External Added to denote the issue can be worked on by a contributor label Dec 17, 2024
Copy link

melvin-bot bot commented Dec 17, 2024

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

@melvin-bot melvin-bot bot changed the title Android - Create Chat - "You appear to be offline" is displayed floating on room creation [$250] Android - Create Chat - "You appear to be offline" is displayed floating on room creation Dec 17, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 17, 2024
@greg-schroeder greg-schroeder removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 17, 2024
Copy link

melvin-bot bot commented Dec 17, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Dec 17, 2024
@greg-schroeder
Copy link
Contributor

Awaiting results of the above, removing Help Wanted. Can you confirm #54157 (comment) @DylanDylann?

@DylanDylann
Copy link
Contributor

DylanDylann commented Dec 18, 2024

This bug is fixed by #53327

Screen.Recording.2024-12-18.at.11.06.20.mov

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

truph01 commented Dec 23, 2024

I am still able to reproduce this bug:

Screen.Recording.2024-12-23.at.15.19.11.mov

There is a blank area at the bottom of the screen, causing the "You appear to be offline" message to float during room creation. This blank area’s height is inconsistent because it dynamically depends on the value of keyboard.progress.value, as implemented in the react-native-keyboard-controller. The value ranges between 0 and 1, representing the keyboard's animation progress.

When logging keyboard.progress.value, I observed that it fluctuates inconsistently within the 0 to 1 range. For example:

When keyboard.progress.value is closer to 0 (e.g., 0.1, 0.2), the blank area’s height is minimal.
When it approaches 1, the blank area becomes significantly larger.

The reason why the value isn’t 0 even when the keyboard is successfully closed is explained in my proposal.

Copy link

melvin-bot bot commented Dec 23, 2024

@greg-schroeder, @DylanDylann Eep! 4 days overdue now. Issues have feelings too...

@DylanDylann
Copy link
Contributor

DylanDylann commented Dec 23, 2024

Calm down Melv, I need to check the above comment and evaluate this issue again

@melvin-bot melvin-bot bot removed the Overdue label Dec 23, 2024
@DylanDylann
Copy link
Contributor

@truph01 How about this KeyboardAvoidingView? Do we need to remove it?

<KeyboardAvoidingView
style={styles.h100}
behavior="padding"
// Offset is needed as KeyboardAvoidingView in nested inside of TabNavigator instead of wrapping whole screen.
// This is because when wrapping whole screen the screen was freezing when changing Tabs.
keyboardVerticalOffset={variables.contentHeaderHeight + variables.tabSelectorButtonHeight + variables.tabSelectorButtonPadding + insets.top}
>

@truph01
Copy link
Contributor

truph01 commented Dec 24, 2024

How about this KeyboardAvoidingView? Do we need to remove it?

That KeyboardAvoidingView will be used to handle when the keyboard is opened in the workspace new room page (when we focus on the Room name field, Room description field, ... So we don't need to remove it.

@DylanDylann
Copy link
Contributor

Yeah, but I worry that this KeyboardAvoidingView will affect the ValuePicker component

@truph01
Copy link
Contributor

truph01 commented Dec 24, 2024

Yeah, but I worry that this KeyboardAvoidingView will affect the ValuePicker component

There's no need to worry. The KeyboardAvoidingView is only active in scenarios where the keyboard is present. Since the ValuePicker does not include any input fields, there's no instance where the keyboard would appear, ensuring that KeyboardAvoidingView won't impact its functionality.

@greg-schroeder greg-schroeder moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Jan 6, 2025
@DylanDylann
Copy link
Contributor

Not overdue, waiting for @youssef-lr to give an official assignment

@melvin-bot melvin-bot bot removed the Overdue label Jan 7, 2025
@greg-schroeder
Copy link
Contributor

Bump @youssef-lr on the above

Copy link

melvin-bot bot commented Jan 9, 2025

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

Offer link
Upwork job

@melvin-bot melvin-bot bot added the Overdue label Jan 9, 2025
Copy link

melvin-bot bot commented Jan 9, 2025

📣 @truph01 🎉 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 📖

@youssef-lr
Copy link
Contributor

Not overdue.

@greg-schroeder
Copy link
Contributor

PR is approved but not merged; seems there's some confusion over the implementation. @DylanDylann can you summarize quickly as it's a little hard to follow. 🤔

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jan 21, 2025
@melvin-bot melvin-bot bot changed the title [$250] Android - Create Chat - "You appear to be offline" is displayed floating on room creation [HOLD for payment 2025-01-28] [$250] Android - Create Chat - "You appear to be offline" is displayed floating on room creation Jan 21, 2025
Copy link

melvin-bot bot commented Jan 21, 2025

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 21, 2025
Copy link

melvin-bot bot commented Jan 21, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.87-3 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 2025-01-28. 🎊

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

Copy link

melvin-bot bot commented Jan 21, 2025

@DylanDylann @greg-schroeder @DylanDylann The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@garrettmknight garrettmknight moved this from Bugs and Follow Up Issues to Hold for Payment in [#whatsnext] #expense Jan 21, 2025
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jan 27, 2025
@greg-schroeder
Copy link
Contributor

Payment date is not 'til tomorrow

@DylanDylann
Copy link
Contributor

DylanDylann commented Jan 28, 2025

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: None

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Test:

  1. Turn off internet connection.
  2. Tap on FAB and select "Start Chat"
  3. Tap on "Room"
  4. Focus on "Room name" input so that the keyboard is opened.
  5. Tap on "Workspace" or "Visibility".
  6. Verify that the "You appear to be offline" message is displayed at the bottom of the screen.

Do we agree 👍 or 👎

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
Status: Hold for Payment
Development

No branches or pull requests

6 participants