-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add support for skipping sending usage pixels for remote messages #902
Conversation
self.content = try container.decodeIfPresent(RemoteMessageModelType.self, forKey: .content) | ||
self.matchingRules = try container.decode([Int].self, forKey: .matchingRules) | ||
self.exclusionRules = try container.decode([Int].self, forKey: .exclusionRules) | ||
self.isMetricsEnabled = try container.decodeIfPresent(Bool.self, forKey: .isMetricsEnabled) ?? true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ?? true
part is why we require custom init function
|
||
var isMetricsEnabled: Bool { | ||
metrics?.state.flatMap(JsonMetrics.MetricsState.init) != .disabled | ||
} | ||
} | ||
|
||
struct JsonMetrics: Decodable { | ||
let state: String? | ||
|
||
enum MetricsState: String, Decodable { | ||
case disabled | ||
case enabled | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the actual change – parse metrics
object within the message definition if it exists and decode state
property. If "disabled", disable metrics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file contains all supported cases for metrics object, including no metrics object at all.
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "CxxCrashHandler" | ||
BuildableName = "CxxCrashHandler" | ||
BlueprintName = "CxxCrashHandler" | ||
ReferencedContainer = "container:"> | ||
</BuildableReference> | ||
</BuildActionEntry> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this part of the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My Xcode keeps bugging me about adding this. It's an update to the otherwise auto-generated scheme, so I reckon it doesn't hurt to include it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, thanks for the detailed instructions.
* main: Remove unused VPN session utilities (#898) Add new deprecated Mac remote message attribute. (#903) Resetting all state for the VPN will cancel the tunnel and stop the monitors (#900) Add support for skipping sending usage pixels for remote messages (#902) Bump Tests/BrowserServicesKitTests/Resources/privacy-reference-tests (#896) Removes the listen port from the wireguard client (#901) Be explicit when performing developer redirects (#884) C-S-S cross origin fixes Update C-S-S version (#892) Add a debug menu action to reset Remote Messages on macOS (#891) Add desktop specific RMF attributes (#883) Upload exception message to Sentry (#856) Add locale to broken site report (#889) Add new subfeature for duckplayer (#885) Swiftlint refactoring (#882) Remote Messaging Framework for macOS (#876)
Please review the release process for BrowserServicesKit here.
Required:
Task/Issue URL: https://app.asana.com/0/1201621708115095/1207841204698435/f
iOS PR: duckduckgo/iOS#3106
macOS PR: duckduckgo/macos-browser#2994
What kind of version bump will this require?: Major
Description:
This change allows to skip sending usage pixels for a given remote message if that's stated in the RMF config.
Steps to test this PR:
For both iOS and macOS apps:
https://www.jsonblob.com/api/1263462242434539520
. This config contains 4 messages: 1, 2, and 4 send pixels, and 3 has pixels disabled.OS Testing:
Internal references:
Software Engineering Expectations
Technical Design Template