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

[$1000] Web - Not Allowed sign when hovering through the reaction list #21354

Closed
1 of 6 tasks
kbecciv opened this issue Jun 22, 2023 · 11 comments
Closed
1 of 6 tasks

[$1000] Web - Not Allowed sign when hovering through the reaction list #21354

kbecciv opened this issue Jun 22, 2023 · 11 comments
Assignees
Labels
Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Jun 22, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

Action Performed:

  1. Go to chat with previous messages.
  2. go to any message hover over the reaction list and notice that there is no 'Not Allowed' sign showing up.
  3. Now click the message body and hover over the reaction list again. notice there is a 'Not Allowed' sign showing up.

Expected Result:

No 'Not Allowed' sign showing up.

Actual Result:

The 'Not Allowed' sign showing up.

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.31.2

Reproducible in staging?: yes

Reproducible in production?: no

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

Notes/Photos/Videos: Any additional supporting documentation

Hover.Error-1.1.mp4
Recording.3222.mp4

Expensify/Expensify Issue URL:

Issue reported by: @daveSeife

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1687467815718419

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018e36cd61ebc57ae7
  • Upwork Job ID: 1672048109219315712
  • Last Price Increase: 2023-06-23
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Jun 22, 2023
@OSBotify
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.

@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

Triggered auto assignment to @jasperhuangg (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@cubuspl42
Copy link
Contributor

cubuspl42 commented Jun 22, 2023

Proposal

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

When a message in the chat is clicked, its reaction modal starts triggering the "not allowed" cursor when the space between reactions is hovered.

What is the root cause of that problem?

A recent change uncovered a bug in PressableWithFeedback.

onPress is not a required property, but it was treated like it was. If a PressableWithFeedback instance was pressed (clicked) but onPressed was undefined, an exception was thrown. Consequently, the logic to re-enable the component (meant for the case when props.onPressed returns a promise) wasn't fired and it was left in the disabled state.

A disabled pressable has the not-allowed cursor.

ReportActionItem isn't providing onPress to PressableWithSecondaryInteraction (which forwards it to PressableWithFeedback). ReportActionItem's PressableWithSecondaryInteraction is an ancestor to the reaction picker, so the space between the reaction entries inherits the cursor style.

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

We should refactor the onPress callback passed to GenericPressable in PressableWithFeedback so it works correctly in all cases:

  • when props.onPress is not provided (it's undefined)
  • when props.onPress is provided and it's async (it returns a Promise)
  • when props.onPress is provided and it's not async (it returns something else, presumably undefined)

A simple implementation that satisfies these requirements could look like this:

onPress={(e) => {
    if (!props.onPress) return;

    const onPressResult = props.onPress(e);
    if (onPressResult instanceof Promise) {
        setDisabled(true);
        InteractionManager.runAfterInteractions(() => {
            onPressResult.finally(() => {
                setDisabled(props.disabled);
            });
        });
    }
}}

@melvin-bot melvin-bot bot added Daily KSv2 and removed Hourly KSv2 labels Jun 22, 2023
@jasperhuangg jasperhuangg removed the DeployBlockerCash This issue or pull request should block deployment label Jun 23, 2023
@jasperhuangg
Copy link
Contributor

Removing deploy blocker label since I don't think we need to block deploy on such a minor issue. It seems you can still react to comments so it doesn't actual break any existing behavior.

@jasperhuangg jasperhuangg added the External Added to denote the issue can be worked on by a contributor label Jun 23, 2023
@melvin-bot melvin-bot bot changed the title Web - Not Allowed sign when hovering through the reaction list [$1000] Web - Not Allowed sign when hovering through the reaction list Jun 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

Triggered auto assignment to @trjExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

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

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

melvin-bot bot commented Jun 23, 2023

📣 @cubuspl42 You have been assigned to this job by @jasperhuangg!
Please apply to this job in Upwork 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 📖

@situchan
Copy link
Contributor

I think this was already fixed in #21341

@cubuspl42
Copy link
Contributor

@situchan
Oh, thanks for spotting that

I would argue that the bug I described in my root cause analysis is still there in some form. If props.onPress throws, the component would again lock itself in the disabled state. The implementation is also unnecessarily complex and bug-prone, firing runAfterInteractions for simple cases when onPress is not async.

@jasperhuangg
Copy link
Contributor

Hmmm after retesting I agree that it was fixed in that other PR. This is a pretty minor flow that doesn't affect behavior so I'm gonna close it out. Thanks for your understanding @cubuspl42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants