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 2023-11-06] [$500] [Violation] Added non-passive event listener to a scroll-blocking 'wheel' event #26990

Closed
marcaaron opened this issue Sep 7, 2023 · 59 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2

Comments

@marcaaron
Copy link
Contributor

marcaaron commented Sep 7, 2023

2023-09-07_09-57-35

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0180d44e7dee5aa64d
  • Upwork Job ID: 1701421752840802304
  • Last Price Increase: 2023-09-12
  • Automatic offers:
    • tienifr | Contributor | 26646331
Issue OwnerCurrent Issue Owner: @johncschuster
@marcaaron marcaaron added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 7, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 7, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@neonbhai
Copy link
Contributor

neonbhai commented Sep 7, 2023

image

This is because this patch does not pass {passive: true} to the addEventListener() function for the 'wheel' event

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@flaviadefaria
Copy link
Contributor

@marcaaron can you add a bit more info here? Are you going to fix this? Should I add an internal label? Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Sep 11, 2023
@marcaaron marcaaron added the External Added to denote the issue can be worked on by a contributor label Sep 12, 2023
@melvin-bot melvin-bot bot changed the title [Violation] Added non-passive event listener to a scroll-blocking 'wheel' event [$500] [Violation] Added non-passive event listener to a scroll-blocking 'wheel' event Sep 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

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

melvin-bot bot commented Sep 12, 2023

Current assignee @flaviadefaria is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

@marcaaron
Copy link
Contributor Author

Sorry @flaviadefaria. Sending it to External to fix.

@tienifr
Copy link
Contributor

tienifr commented Sep 12, 2023

Proposal

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

Warning [Violation] Added non-passive event listener to a scroll-blocking 'wheel' event

What is the root cause of that problem?

This issue comes from react-native-web. In that lib here we're not using passive options for performance improvement when adding listener for the 'wheel' event. More details on the passive option here.

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

We need to add supportsPassive ? { passive: true } : false as the third argument in here. We need to set up feature detection (the supportsPassive) to make sure it supports passive, since for older browsers, any object passed as the third argument will mean capture: true, which we don't want (see here for more details).

I noticed a couple of places in our App, we're not setting the passive option as well (for example here and here), we can consider fixing them there similarly.

What alternative solutions did you explore? (Optional)

touchstart and touchmove event listeners have the same issues and we can consider fixing them similarly.

@thesahindia
Copy link
Member

@tienifr's proposal looks good to me!

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

Triggered auto assignment to @danieldoglas, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

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

melvin-bot bot commented Sep 13, 2023

📣 @thesahindia Please request via NewDot manual requests for the Reviewer role ($500)

@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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

@tienifr

This comment was marked as outdated.

@johncschuster
Copy link
Contributor

Same^

@johncschuster
Copy link
Contributor

Still waiting on PR in RNW upstream to be resolved #26990 (comment)

@tienifr
Copy link
Contributor

tienifr commented Apr 4, 2024

@johncschuster @danieldoglas Upstream PR was finally merged necolas/react-native-web#2601 and will be released in the next react-native-web version. But I'm not sure what's the next step here. Should we close this issue now or wait for the next react-native-web version upgrade in App?.

@johncschuster
Copy link
Contributor

@tienifr great question! I'm not really sure myself. I'll let @danieldoglas weigh in on that.

@danieldoglas
Copy link
Contributor

Let's wait until we have the new version of upgraded in the app!

@bernhardoj
Copy link
Contributor

FYI, this is the PR that upgrades the rn-web that includes the upstream fix from this issue

@tienifr
Copy link
Contributor

tienifr commented Apr 25, 2024

Thanks @bernhardoj.

@bernhardoj
Copy link
Contributor

Hey, the PR is currently blocked with the upstream PR from this issue. Adding {passive: true} to the wheel listener broke the scrolling of an inverted list (report screen uses inverted list) and also giving lots of console errors. It's also reported in the upstream issue here.

Screen.Recording.2024-04-30.at.10.34.32.1.2.mov

Can someone take a look, please?

@tienifr
Copy link
Contributor

tienifr commented May 2, 2024

@bernhardoj Thanks, I'm taking a look. However, suppose that we need another PR to fix that, what would we do next? Because as I see the maintainer's update frequency is very rare.

@bernhardoj
Copy link
Contributor

@tienifr I think when you open the PR, you can ask the maintainer whether it's possible to release the PR as soon as it's merged because I think it's a critical issue.

If that's not possible, maybe I can create a patch that revert it to unblock my PR?

cc: @danieldoglas

@johncschuster
Copy link
Contributor

I'm having a hard time understanding where we're at with this currently. What are we waiting on?

@melvin-bot melvin-bot bot removed the Overdue label May 7, 2024
@bernhardoj
Copy link
Contributor

@johncschuster I believe we are waiting on @tienifr to raise a new upstream fix for this issue.

@johncschuster
Copy link
Contributor

Awesome. Thank you, @bernhardoj!

@bernhardoj
Copy link
Contributor

@danieldoglas do you think I should create a patch to revert necolas/react-native-web#2601 to unblock #33502?

@tienifr
Copy link
Contributor

tienifr commented May 14, 2024

Hi @bernhardoj @danieldoglas @johncschuster I spent a lot of time digging into this and found out that we couldn't fix this warning issue [Violation] Added non-passive event listener to a scroll-blocking 'wheel' event because RNW implemented custom logic for handling scrolling for inverted list and passive event does not support it by default.

I think what's next here is we reverted the upstream PR (to prevent the default passive event behavior breaking the inverted scrolling function) and ignore the warning.

@tienifr
Copy link
Contributor

tienifr commented May 14, 2024

Revert PR is here: necolas/react-native-web#2667.

@johncschuster
Copy link
Contributor

Awesome. Thanks for the update and PR, @tienifr!

@tienifr
Copy link
Contributor

tienifr commented May 22, 2024

PR is merged. @bernhardoj you're unblocked now. @johncschuster we can close this.

@bernhardoj
Copy link
Contributor

Not released yet, so I'm still blocked.

@tienifr
Copy link
Contributor

tienifr commented May 22, 2024

Unblocked now.

@johncschuster
Copy link
Contributor

Thanks for the update, @tienifr! Just so I'm clear, we can now close this issue, right? All we need how to issue payment, correct?

@tienifr
Copy link
Contributor

tienifr commented May 22, 2024

@johncschuster Yes, payment was issued for me already here (not sure about the C+).

After all payments are done we're good to close.

@johncschuster
Copy link
Contributor

@thesahindia, it looks like you were pinged to request payment for this issue, here, can you confirm you've received payment? If so, it sounds like we can close this one out.

@thesahindia
Copy link
Member

I will send a money request soon. Feel free to close it!

@JmillsExpensify
Copy link

$500 approved for @thesahindia based on this summary.

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. External Added to denote the issue can be worked on by a contributor Monthly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants