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

Listen for referral headers updates #892

Merged
merged 1 commit into from Nov 12, 2018

Conversation

emerick
Copy link
Contributor

@emerick emerick commented Nov 12, 2018

Fixes brave/brave-browser#2020

We were previously only retrieving the referral headers on first
launch. Aside from preventing us from incorporating potential updates
to the headers, this also made it so that a browser restart was
required the first time a user initialized the referral (as the
referral headers would still be empty from the network delegate's
perspective).

Now we register for changes to that preference and pull them in on the
fly.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Verified that these changes build without errors on
    • Windows
    • macOS
    • Linux
  • Verified that these changes pass automated tests (npm test brave_unit_tests && npm test brave_browser_tests) on
    • Windows
    • macOS
    • Linux
  • Ran git rebase master (if needed).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Yes or QA/No) to include the closed issue in milestone

Test Plan:

  • Delete existing profile if any
  • Download referral version of Brave (e.g., BraveBrowserSetup-dowjones-marketwatch.exe)
  • Install referral version of Brave
  • Wait for promo tab to load
  • Sign up for promo and visit a URL belonging to the site
  • Ensure that headers include appropriate promo-specific headers, e.g. X-Brave-Partner

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

We were previously only retrieving the referral headers on first
launch. Aside from preventing us from incorporating potential updates
to the headers, this also made it so that a browser restart was
required the first time a user initialized the referral (as the
referral headers would still be empty from the network delegate's
perspective).

Now we register for changes to that preference and pull them in on the
fly.
@emerick emerick self-assigned this Nov 12, 2018
@emerick emerick requested a review from bbondy November 12, 2018 14:54
@emerick emerick merged commit c532659 into master Nov 12, 2018
@emerick emerick deleted the listen-for-referral-headers-changes branch November 12, 2018 14:59
@emerick
Copy link
Contributor Author

emerick commented Nov 12, 2018

master: c532659
0.58.x: 3871c13
0.57.x: b9fee322

@kjozwiak
Copy link
Member

kjozwiak commented Nov 28, 2018

@emerick can we get this uplifted into dev so it can make it into 0.58.x when it moves into beta next week? There's no approval requirement to land things into dev at this moment.

@bbondy
Copy link
Member

bbondy commented Nov 28, 2018

does @aekeus need this for 0.57.x?

emerick added a commit that referenced this pull request Nov 28, 2018
Listen for referral for referral headers updates
@emerick
Copy link
Contributor Author

emerick commented Nov 28, 2018

@aekeus @kjozwiak Uplifted to dev. Please let me know if I should request uplift to 0.57.x as well.

@emerick emerick changed the title Listen for referral for referral headers updates Listen for referral headers updates Nov 28, 2018
@srirambv
Copy link
Contributor

srirambv commented Nov 28, 2018

@emerick uplift approved for 0.57.x. Please update label once merged to 0.57.x

emerick added a commit that referenced this pull request Nov 28, 2018
Listen for referral for referral headers updates
@bbondy
Copy link
Member

bbondy commented Nov 28, 2018

0.57.x has wrong changeset above but it is actually landed:
669baa8

@bbondy bbondy added this to the 0.57.x - Release milestone Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants