Conversation
This commit adds a fallback mechanism for health tracking initialization using `localStorage` to enable fast boot-time access to the health tracking flag (`Phoenix.healthTrackingDisabled`) before persistent preferences are fully loaded. Key changes: - `Phoenix.healthTrackingDisabled` is initialized from `localStorage` at boot. - Introduced `Phoenix._setHealthTrackingDisabled()` to update both the in-memory flag and localStorage. - Added a safety check in `HealthDataManager.js` to detect mismatches between boot-time localStorage and actual persisted preferences. If a mismatch is detected, a one-time `"disableErr"` metric is raised to track potential early metric leakage. - Updated Bugsnag and metrics initialization logic to respect `Phoenix.healthTrackingDisabled`. - Updated the health data opt-out UI and strings to reflect necessary/always-collected data. - Updated test runner to mimic `localStorage`-based health flag boot logic. This ensures **eventual consistency** between boot-time behavior and persisted user preferences, while maintaining **privacy guarantees** by deferring any personal or anonymous health reporting until health tracking is explicitly enabled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This commit adds a fallback mechanism for health tracking initialization using
localStorageto enable fast boot-time access to the health tracking flag (Phoenix.healthTrackingDisabled) before persistent preferences are fully loaded.Updated dialog
Highlights essential anonymous data raised to be more explicit on what is necessary data. This does not violate GDPR/CCPA as these are still anonymous stats.

Key changes:
Phoenix.healthTrackingDisabledis initialized fromlocalStorageat boot.Phoenix._setHealthTrackingDisabled()to update both the in-memory flag and localStorage.HealthDataManager.jsto detect mismatches between boot-time localStorage and actual persisted preferences. If a mismatch is detected, a one-time"disableErr"metric is raised to track potential early metric leakage.Phoenix.healthTrackingDisabled.localStorage-based health flag boot logic.This ensures eventual consistency between boot-time behavior and persisted user preferences, while maintaining privacy guarantees by deferring any personal or anonymous health reporting until health tracking is explicitly enabled.