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

Remove GPC header if it exists when not needed #366

Merged
merged 6 commits into from
Jan 18, 2022
Merged

Conversation

SlayterDev
Copy link
Contributor

Task/Issue URL:
Tech Design URL:
CC:

Description:
Fixes an issue where GPC header wasn't removed when allow listing a site

Steps to test this PR:

  1. Visit https://global-privacy-control.glitch.me/
  2. Observe header present returns true
  3. Turn protections off and refresh page
  4. Header present should show false

Testing checklist:

  • Test with Release configuration

Internal references:

Software Engineering Expectations
Technical Design Template
When ready for review, remember to post the PR in MM

@tomasstrba tomasstrba self-requested a review December 9, 2021 11:09
@tomasstrba tomasstrba self-assigned this Dec 9, 2021
Copy link
Contributor

@tomasstrba tomasstrba left a comment

Choose a reason for hiding this comment

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

Nice Brad! 👍 Just few details to polish since algo has to be as optimized as possible.

Please, could you also merge with develop? In the current version, there is an issue with user scripts and I got 'GPC signal not detected' in https://globalprivacycontrol.org/. It may be related

DuckDuckGo/GPC/GPCRequestFactory.swift Outdated Show resolved Hide resolved
DuckDuckGo/GPC/GPCRequestFactory.swift Show resolved Hide resolved
@tomasstrba tomasstrba assigned SlayterDev and unassigned tomasstrba Dec 9, 2021
@SlayterDev
Copy link
Contributor Author

Please, could you also merge with develop? In the current version, there is an issue with user scripts and I got 'GPC signal not detected' in https://globalprivacycontrol.org/. It may be related

Looks good on my end 👍

@tomasstrba tomasstrba assigned tomasstrba and unassigned SlayterDev Dec 10, 2021
Copy link
Contributor

@tomasstrba tomasstrba left a comment

Choose a reason for hiding this comment

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

@SlayterDev, in the current implementation GPCRequestFactory may end up with the outdated configuration.

@tomasstrba tomasstrba assigned SlayterDev and unassigned tomasstrba Dec 13, 2021
@tomasstrba
Copy link
Contributor

tomasstrba commented Dec 13, 2021

I'm afraid this went the other direction I suggested. Now there are cases when privacy config data are out of sync.

Can privacyConfig of PrivacyConfigurationManager be refactored? The problem in initial implementation was it was a computed property triggering a computation on every access. Even worse is it accesses fetchedConfigData under the lock with blocks concurrent loading. In ideal case, privacyConfig is accessed as before (so the there are latest data everywhere) but it is precomputed (not a computed property but stored). When related data change (fetchedData, localProtection) then the property is updated. Is such refactoring possible?

@tomasstrba
Copy link
Contributor

Hey @SlayterDev, please, can I help with this? I didn't want to block you. Please, feel free to merge with the version you are comfortable and we can resolve the optimisation as a follow-up task.

@SlayterDev
Copy link
Contributor Author

Sounds good @tomasstrba. I meant to get with @bwaresiak on this but many things have come up since then.

@SlayterDev SlayterDev merged commit f8c756a into develop Jan 18, 2022
@SlayterDev SlayterDev deleted the brad/gpc-fix branch January 18, 2022 13:59
samsymons added a commit that referenced this pull request Feb 18, 2022
# By Alexey Martemyanov (20) and others
# Via Tomas Strba (2) and others
* develop: (63 commits)
  Tweaks of suggestions and autocomplete (#403)
  Bump privacy dashboard to latest version (#409)
  Point to the latest BrowserServicesKit branch. (#414)
  Move embedded TDS from BSK to platform repo (#412)
  Image of shield with dot replaced (#410)
  Expand Fireproofing to include Local Storage and IndexedDB (#408)
  Version 0.18.5
  support privacy config for clickToLoad (#407)
  Automatically select available login (#405)
  initial FB Click to Load (WIP) (#329)
  onboarding updates (#398)
  Version 0.18.4
  Configuration of Sparkle - Setting SUAllowsAutomaticUpdates to NO (#404)
  Hide downloads button if the popover is opened/closed manually (#397)
  Textfield of the homepage is empty and unfocused right after switching to the homepage (#400)
  Remove navigatorCredentials (#392)
  Remove GPC header if it exists when not needed (#366)
  Version 0.18.3
  Fireproofing encrypted storage (#332)
  Fix Lock Screen UI issues (#399)
  ...

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo/Crash Reports/Model/CrashReportSender.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants