Skip to content

fix: audit health data and update health notification#2174

Merged
abose merged 1 commit intomainfrom
x
Mar 22, 2025
Merged

fix: audit health data and update health notification#2174
abose merged 1 commit intomainfrom
x

Conversation

@abose
Copy link
Member

@abose abose commented Mar 22, 2025

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.

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.
image

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 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.
@sonarqubecloud
Copy link

@abose abose merged commit c336a24 into main Mar 22, 2025
18 of 19 checks passed
@abose abose deleted the x branch March 22, 2025 11:29
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.

1 participant