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 React Native 0.76] [$250] iOS Workspace - Invite message field does not auto-focus #53346

Open
2 of 8 tasks
IuliiaHerets opened this issue Nov 30, 2024 · 21 comments
Open
2 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering 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 Monthly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 30, 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.69-1
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
Email or phone of affected tester (no customers): applausetester [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Launch ND or hybrid app.
  2. Go to workspace settings > Members.
  3. Tap Invite member.
  4. Select a member > Next.

Expected Result:

Invite message field will auto-focus (production behavior).

Actual Result:

Invite message field does not auto-focus.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6680726_1732980651973.ScreenRecording_11-30-2024_23-28-21_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021863622226791951808
  • Upwork Job ID: 1863622226791951808
  • Last Price Increase: 2024-12-09
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Nov 30, 2024
Copy link

melvin-bot bot commented Nov 30, 2024

Triggered auto assignment to @puneetlath (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Nov 30, 2024

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

Copy link

melvin-bot bot commented Nov 30, 2024

💬 A slack conversation has been started in #expensify-open-source

@melvin-bot melvin-bot bot added the Daily KSv2 label Nov 30, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Nov 30, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@mountiny mountiny added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Dec 1, 2024
@mountiny
Copy link
Contributor

mountiny commented Dec 1, 2024

@chrispader @kirillzyusko @hannojg something to look into, i dont think this is a blocker so demoted.

@sakluger sakluger added the External Added to denote the issue can be worked on by a contributor label Dec 2, 2024
Copy link

melvin-bot bot commented Dec 2, 2024

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

@melvin-bot melvin-bot bot changed the title iOS Workspace - Invite message field does not auto-focus [$250] iOS Workspace - Invite message field does not auto-focus Dec 2, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 2, 2024
Copy link

melvin-bot bot commented Dec 2, 2024

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

@sakluger sakluger moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Dec 2, 2024
@brunovjk
Copy link
Contributor

brunovjk commented Dec 3, 2024

I can reproduce. It seems related to FE, looking for proposals.

v9.0.69-2 Develop
Screen.Recording.2024-12-03.at.09.56.21.mov

@QichenZhu
Copy link
Contributor

Proposal

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

The input field for the message to invite workspace members doesn’t auto-focus.

What is the root cause of that problem?

The updateMultilineInputRange() function tries to focus the input but fails silently due to a known React Native bug.

updateMultilineInputRange(element);

Details can be found in the upstream issue facebook/react-native#47576.

In the new architecture, native view commands are dispatched immediately to the UI thread

But mounting operations are only flushed at the end of the current task in the event loop / runtime scheduler

That causes problems when invoking native view commands on views that were just created

On Android, this works correctly because we queue the native view command in the same queue as mount operations, so they're always processed in the right order.

This shares the same cause as #51728.

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

Like #51728, I suggest holding this for React Native upgrade, as this doesn't affect the app's functionality.

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

There is no need to add tests, as this is caused by an upstream bug.

What alternative solutions did you explore? (Optional)

A number of similar issues are worked around by focusing with a delay, which is already implemented in the useAutoFocusInput hook. However, it doesn't work currently because the first failing focus attempt causes future programmatic focus to fail as well. To make useAutoFocusInput work, we need to empty the updateMultilineInputRange() function on iOS.

const updateMultilineInputRange: UpdateMultilineInputRange = (input, shouldAutoFocus = true) => {

const updateMultilineInputRange: UpdateMultilineInputRange = (input, shouldAutoFocus = true) => {/* Do nothing */}

@brunovjk
Copy link
Contributor

brunovjk commented Dec 4, 2024

Thank you for the proposal, @QichenZhu. I think your RCA makes sense, and holding for the RN upgrade isn’t a bad idea. I tested your alternative solution, and it fixes the issue, but I haven’t checked for regressions elsewhere. @puneetlath, could you advise on the next steps? Thank you!

🎀👀🎀 C reviewed

Copy link

melvin-bot bot commented Dec 4, 2024

Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@kirillzyusko
Copy link
Contributor

Thank you @QichenZhu for a proposal

I like it and I think we can go with that. The only thing that we need to come to agreement is whether we should wait for next RN upgare (will it be fixed in 0.76) or we need to create a workaround/fix and remove it when update to RN 0.76 will happen?

@QichenZhu
Copy link
Contributor

Thanks for the feedback! The fix will be released in 0.77. We can also submit a pick request to ask them to include it in older versions like 0.75 or 0.76 if needed.

@kirillzyusko
Copy link
Contributor

Well, I think it's up to Expensify team on which approach to choose.

One thing I can say from my side is that we are still on RN 0.75 and have a pending PR with RN 0.76, so if the fix is available only in RN 0.77 then I think it may take up to several months to close this issue 👀

P. S. just had a look on PR with the fix - @QichenZhu can't we apply these changes as a patch? I think we are building from sources, so c code shouldn't be a problem? Or are you aware about potential issues/problems?

@QichenZhu
Copy link
Contributor

can't we apply these changes as a patch?

@kirillzyusko Yes, it’s possible.

I’ve tried to backport the fix to 0.75 and drafted a patch in my proposal for another issue.

Since 0.75 and 0.77 span two major versions and this involves changes to the scheduler, it will need thorough testing.

I think it would be safer to patch 0.76, which is closer to 0.77, or we could request the RN team to handle it.

Let’s wait for the Expensify team’s decision.

Copy link

melvin-bot bot commented Dec 9, 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 9, 2024
@sakluger
Copy link
Contributor

sakluger commented Dec 9, 2024

Not overdue, just waiting for Puneet's review.

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

Is this the only flow that is affected by this bug? If so, it feels not really worth patching to me and it'd be fine to wait for the fix to go-live upstream.

@brunovjk
Copy link
Contributor

Is this the only flow that is affected by this bug? If so, it feels not really worth patching to me and it'd be fine to wait for the fix to go-live upstream.

I think there are others, like this one, mentioned by @QichenZhu, but also on hold for the React Native 0.76 upgrade. I think it’s worth holding here as well. I’ll keep an eye on this and test the issue afterward. Thought @sakluger @puneetlath?

@puneetlath puneetlath changed the title [$250] iOS Workspace - Invite message field does not auto-focus [HOLD React Native 0.76] [$250] iOS Workspace - Invite message field does not auto-focus Dec 11, 2024
@puneetlath puneetlath added Monthly KSv2 and removed Daily KSv2 labels Dec 11, 2024
@puneetlath
Copy link
Contributor

That sounds good to me. I put it on hold.

@brunovjk
Copy link
Contributor

Still on hold for Upgrade to React Native 0.76

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. Engineering 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 Monthly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

7 participants