-
Notifications
You must be signed in to change notification settings - Fork 22
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
Bug: UA indicates we should show consent message even after user has already opted out #272
Comments
@andrewkolos can you work on this bug? It has pretty serious correctness implications for how we use analytics. |
Could you clarify what the expected behavior is here? My personal interpretation is that the user should be opted into telemetry for tool B but not for tool A, as these are two separate tools. However, the issue description seems to imply that disabling telemetry for tool A should disable telemetry for any other tool that is run in the future. I do agree that tool A's telemetry should not be re-enabled without the user explicitly enabling it. This is definitely a bug. |
Actually, I didn't verify that this is even the case, so I am not even sure there is a bug here. |
The intent of unified_analytics is that there would be a single opt-in / opt-out state for analytics that is shared across all Dash tools. When we show the analytics notice, we also set the reporting flag to true, and then a user is expected to manually opt out if they do not want analytics to be collected. The bug is coming from when we decide to show the notice and set the opt-in to true. As the PDD currently stands "If the reporting control flag ("reporting") is set to opt-out of reporting, then no notices should be shown in any tool." This is what we are currently violating by showing the analytics notice in tool B in the example above. |
This was the part that surprised me to the point of me questioning whether I was reading this issue correctly. Thanks for clarifying. I'll get back to fixing this. |
From reading the code and doing some testing on a fresh VM, I don't think the prompt on the second tool re-enables telemetry. I wrote a test to verify this: tools/pkgs/unified_analytics/test/unified_analytics_test.dart Lines 1301 to 1303 in 5997ca9
I also ported this test to the 5.8.8 branch on my local checkout, and it still passed. So I think the only bug here is that Footnotes
|
@andrewkolos to 1) take a second pass over the unified_analytics code to be confident that the bug described in this issue is not present and then 2) sync up with kenzieschmoll |
Andrew and I looked at the code, and we believe that:
|
Intended behavior per the PDD: "If the reporting control flag ("reporting") is set to opt-out of reporting, then no notices should be shown in any tool."
Current behavior:
The current logic sets
_showMessage
to true for the first run of a Dash tool: https://github.com/dart-lang/tools/blob/main/pkgs/unified_analytics/lib/src/analytics.dart#L447. When a message is shown, the tool showing the message will set analytics enabled to true.However, this doesn't take into account if the user has already run the command to disable analytics, which seems like a bug? Imagine this scenario:
This seems incorrect. If the user just opted out of analytics, we should not be prompting then again.
The code for
shouldShowMessage
just returns the value of_showMessage
, which doesn't take the enabled state into account:https://github.com/dart-lang/tools/blob/main/pkgs/unified_analytics/lib/src/analytics.dart#L516.
Should this be modified to return
_showMessage && !_telemetrySuppressed
? Not sure whether we should check_telemetrySuppressed
or the value oftelemetryEnabled
, or both.@christopherfujino
The text was updated successfully, but these errors were encountered: