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

Check for De-AMP loops using last committed URL #13674

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

ShivanKaul
Copy link
Collaborator

@ShivanKaul ShivanKaul commented Jun 7, 2022

Resolves brave/brave-browser#23320
This should be a more robust check than the one introduced in #13213.

Caveat: Note that this makes it so that if you load an AMP page, wait to be redirected to canonical page, and then enter the same AMP URL again in the same tab, we won't De-AMP it. We will however then De-AMP it if you reload the page.

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:

  1. https://digiday.com/marketing/googles-david-temkin-sheds-light-on-the-companys-preparations-for-disabling-third-party-cookies/amp
  2. https://www.airlive.net/new-footage-shows-an-ukrainian-mig-29-taking-off-from-mykolaiv-seconds-before-the-runway-is-shelled-by-the-russians/
  3. https://thehustle.co/06022022-elvis-vegas-weddings/
  4. https://shivankaul.com/brave/de-amp/test-redirect-loop-1.html and https://shivankaul.com/brave/de-amp/test-redirect-loop-2.html are 2 AMP pages that point to each other. Visiting one should not cause a redirect loop.
  5. https://shivankaul.com/brave/de-amp/test-js-redirect-amp.html should not cause a loop.

@ShivanKaul ShivanKaul requested a review from bridiver June 7, 2022 22:22
@ShivanKaul ShivanKaul self-assigned this Jun 7, 2022
@ShivanKaul ShivanKaul added this to the 1.41.x - Nightly milestone Jun 8, 2022
@ShivanKaul ShivanKaul merged commit 3bab62d into master Jun 8, 2022
@ShivanKaul ShivanKaul deleted the bugfix/de-amp/js-redirect-check branch June 8, 2022 03:46
@ShivanKaul ShivanKaul restored the bugfix/de-amp/js-redirect-check branch June 8, 2022 07:26
brave-builds pushed a commit that referenced this pull request Jun 8, 2022
brave-builds pushed a commit that referenced this pull request Jun 8, 2022
@kjozwiak kjozwiak deleted the bugfix/de-amp/js-redirect-check branch June 8, 2022 15:25
@stephendonner
Copy link
Contributor

stephendonner commented Jun 10, 2022

Verified PASSED using

Brave 1.41.50 Chromium: 102.0.5005.99 (Official Build) nightly (x86_64)
Revision 870f7bcc58dfa811cc68c2186439721385e086d0-refs/branch-heads/5005@{#1125}
OS macOS Version 12.5 (Build 21G5037d)

Reproduced with 1.39.120 on the minimal testcase from the testplan, not the live sites from (which I made sure load fine for me in both release and nightly):

Screen Shot 2022-06-09 at 10 12 49 PM

pref enabled working AMP redirect loop 1 loop 2
Screen Shot 2022-06-09 at 10 11 39 PM Screen Shot 2022-06-09 at 10 12 21 PM Screen Shot 2022-06-09 at 10 18 35 PM Screen Shot 2022-06-09 at 10 18 44 PM

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

Brave | 1.41.59 Chromium: 103.0.5060.42 (Official Build) nightly (64-bit)
-- | --
Revision | de0d840bf9439c31bd86bf74f065c31fdf9b208d-refs/branch-heads/5060@{#667}
OS | Windows 11 Version 21H2 (Build 22000.708)

Went through all the STR/Cases (specifically the websites being listed) via #13674 (comment) and ensured that all the websites mentioned loaded without running into any looping issues.


Verification PASSED on Pixel 6 running Android 13 running the following build(s):

Brave | 1.41.61 Chromium: 103.0.5060.42 (Official Build) canary (32-bit)
--- | ---
Revision | de0d840bf9439c31bd86bf74f065c31fdf9b208d-refs/branch-heads/5060@{#667}
OS | Android 12; Build/TPBB.220414.018

Went through all the STR/Cases (specifically the websites being listed) via #13674 (comment) and ensured that all the websites mentioned loaded without running into any looping issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants