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

Fix incorrect CAPTCHA drag image on scaled Linux display #13072

Merged
merged 1 commit into from
Apr 20, 2022

Conversation

emerick
Copy link
Contributor

@emerick emerick commented Apr 19, 2022

Resolves brave/brave-browser#22180

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

  • Linux settings -> Displays -> Scale -> 100%
  • Clean profile
  • Enable Rewards
  • Claim grant
  • Solve CAPTCHA
  • Close browser
  • Linux settings -> Displays -> Scale -> 200%
  • Clean profile
  • Enable Rewards
  • Claim grant
  • Solve CAPTCHA

We should also test this on Mac and Windows at various resolutions, although there should be no changes on either of those platforms as this fix is scoped to Linux systems running with scaled displays.

@emerick emerick requested a review from a team as a code owner April 19, 2022 18:18
@emerick emerick self-assigned this Apr 19, 2022
@github-actions github-actions bot added the CI/storybook-url Deploy storybook and provide a unique URL for each build label Apr 19, 2022
@emerick
Copy link
Contributor Author

emerick commented Apr 19, 2022

@tmancey mentioned recently that this is no longer a high priority as every 2 hours we fetch new token issuers and when we fetch these we refill tokens.

@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

// image offset when initiating the drag
// See https://bugs.chromium.org/p/chromium/issues/detail?id=1297990
if (window.navigator.userAgent.includes('Linux') && devicePixelRatio > 1) {
event.dataTransfer.setDragImage(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this is this something that will break the captcha (for this subset of users) when the upstream bug is fixed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's possible, unfortunately, depending on how https://bugs.chromium.org/p/chromium/issues/detail?id=1297990 is ultiumately addressed. I tried to limit the impact as much as possible with the platform and devicePixelRatio guards. I feel like any workaround we implement will have to be removed and uplifted once the upstream bug is fixed. Definitely open to other approaches though!

@emerick emerick force-pushed the rewards-fix-drag-image-linux-captcha branch from fa8988d to 5dcc19f Compare April 20, 2022 11:00
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@emerick emerick added CI/skip-android Do not run CI builds for Android CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-ios Do not run CI builds for iOS labels Apr 20, 2022
@emerick
Copy link
Contributor Author

emerick commented Apr 20, 2022

CI passed on all platforms but Windows; restarting on Windows.

@emerick emerick removed CI/skip-android Do not run CI builds for Android CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-ios Do not run CI builds for iOS labels Apr 20, 2022
@emerick
Copy link
Contributor Author

emerick commented Apr 20, 2022

CI passed; ready to merge.

@emerick emerick merged commit 7eae908 into master Apr 20, 2022
@emerick emerick deleted the rewards-fix-drag-image-linux-captcha branch April 20, 2022 15:34
@emerick emerick added this to the 1.39.x - Nightly milestone Apr 20, 2022
brave-builds pushed a commit that referenced this pull request Apr 20, 2022
brave-builds pushed a commit that referenced this pull request Apr 20, 2022
@kjozwiak
Copy link
Member

kjozwiak commented Apr 25, 2022

Verification PASSED on Win 11 x64 using the following build(s):

Brave | 1.40.7 Chromium: 101.0.4951.41 (Official Build) nightly (64-bit)
-- | --
Revision | 93c720db8323b3ec10d056025ab95c23a31997c9-refs/branch-heads/4951@{#904}
OS | Windows 11 Version 21H2 (Build 22000.613)

As per #13072 (comment), went through several different scales on Win 11 x64 and ensured that solving the CAPTCHA worked without any issues.

Scaling Example Example Example Example Example
scaling100 grantpanel1 grantpanel2 grantpanel3 settingsPanel1 settingsPanel2
scaling125 panelgrant1 panelgrant2 panelgrant3 settingspanel1 settingsPanel2
scaling150 panelgrant1 panelgrant2 panelgrant3 settingspanel1 settingspanel2

Verification PASSED on macOS 12.3.1 x64 Monterey using the following build(s):

Brave | 1.40.8 Chromium: 101.0.4951.41 (Official Build) nightly (x86_64)
--- | ---
Revision | 93c720db8323b3ec10d056025ab95c23a31997c9-refs/branch-heads/4951@{#904}
OS | macOS Version 12.3.1 (Build 21E258)
Scaling Example Example Example Example Example
Screen Shot 2022-04-24 at 11 35 53 PM Screen Shot 2022-04-24 at 11 36 09 PM Screen Shot 2022-04-24 at 11 36 16 PM Screen Shot 2022-04-24 at 11 36 26 PM Screen Shot 2022-04-24 at 11 37 51 PM Screen Shot 2022-04-24 at 11 38 00 PM
Screen Shot 2022-04-24 at 11 45 21 PM Screen Shot 2022-04-24 at 11 45 44 PM Screen Shot 2022-04-24 at 11 46 38 PM Screen Shot 2022-04-24 at 11 46 06 PM Screen Shot 2022-04-24 at 11 45 58 PM Screen Shot 2022-04-24 at 11 46 48 PM
Screen Shot 2022-04-24 at 11 51 13 PM Screen Shot 2022-04-24 at 11 51 39 PM Screen Shot 2022-04-24 at 11 52 52 PM Screen Shot 2022-04-24 at 11 52 09 PM Screen Shot 2022-04-24 at 11 51 58 PM Screen Shot 2022-04-24 at 11 53 01 PM

Verification PASSED on PopOS 21.10 x64 using the following build(s):

Brave | 1.40.9 Chromium: 101.0.4951.41 (Official Build) nightly (64-bit)
--- | ---
Revision | 93c720db8323b3ec10d056025ab95c23a31997c9-refs/branch-heads/4951@{#904}
OS | Linux

Used the Retina option via Parallels which really scaled the resolution in the VM.

Scaling Example Example Example Example Example
Screen Shot 2022-04-25 at 12 00 47 AM Screen Shot 2022-04-24 at 11 58 32 PM Screen Shot 2022-04-24 at 11 58 40 PM Screen Shot 2022-04-24 at 11 58 50 PM Screen Shot 2022-04-24 at 11 59 42 PM Screen Shot 2022-04-24 at 11 59 56 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/storybook-url Deploy storybook and provide a unique URL for each build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewards ad earnings claim CAPTCHA cannot be completed (starting April 2022)
5 participants