Skip to content

Bugfix FXIOS-16737 Stop the daily usage ping from following the technical data opt-out - #35515

Open
razvanlitianu wants to merge 4 commits into
mainfrom
rlitianu/fxios-16737-daily-ping
Open

Bugfix FXIOS-16737 Stop the daily usage ping from following the technical data opt-out#35515
razvanlitianu wants to merge 4 commits into
mainfrom
rlitianu/fxios-16737-daily-ping

Conversation

@razvanlitianu

@razvanlitianu razvanlitianu commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

📜 Tickets

Jira ticket
Github issue

💡 Description

Opting out of "Send technical and interaction data" on the Terms of Use card also turned off the Daily Usage Ping, a setting onboarding never shows.

initGlean fell back to sendUsageData when sendDailyUsagePing was unset, which is exactly the state on a fresh install after the ToU handler writes sendUsageData = false. Fallback removed: the ping reads only its own pref and defaults to on, fresh installs and upgrades alike per QA. The default now lives once, in AppConstants.defaultSendDailyUsagePing.

Also reorders two lines in TelemetryWrapperTests.setUp so dependencies bootstrap before Experiments; otherwise the class crashes when it runs first.

Review note: users upgrading from v135 or earlier who opted out of technical data will now get the daily ping on.

🎥 Demos

Settings > Support, after opting out of technical data on the ToU card.

Before After
01-before-settings-daily-ping-off 02-after-settings-daily-ping-on
The Manage sheet the user actually sees during onboarding 03-tou-manage-sheet-no-daily-ping-control

Two toggles, and no daily usage ping control anywhere in the flow.

📝 Checklist

  • I filled in the ticket numbers and a description of my work
  • I updated the PR name to follow our PR naming guidelines
  • I ensured unit tests pass and wrote tests for new code
  • If working on UI, I checked and implemented accessibility (Dynamic Text and VoiceOver)
  • If adding telemetry, I read the data stewardship requirements and will request a data review
  • If adding or modifying strings, I read the guidelines and will request a string review from l10n
  • If needed, I updated documentation and added comments to complex code

@mobiletest-ci-bot

mobiletest-ci-bot commented Sep 3, 2026

Copy link
Copy Markdown
Messages
📖 Project coverage: 44.41%

💪 Quality guardian

1 tests files modified. You're a champion of test coverage! 🚀

🧹 Tidy commit

Just 5 file(s) touched. Thanks for keeping it clean and review-friendly!

💬 Description craftsman

Great PR description! Reviewers salute you 🫡

✅ Code coverage

  • No new files detected so the coverage gate wasn't run.
  • No modified files had significant enough changes for the coverage gate to run.

Client.app: Coverage: 46.08

File Coverage
SendDataSetting.swift 25.61% ⚠️
TelemetryWrapper.swift 57.16%
AppSettingsTableViewController.swift 65.86%

Generated by 🚫 Danger Swift against 114cd43

@razvanlitianu
razvanlitianu marked this pull request as ready for review September 3, 2026 07:46
@razvanlitianu
razvanlitianu requested a review from a team as a code owner September 3, 2026 07:46
@razvanlitianu
razvanlitianu requested review from adudenamedruby and a lite review from Copilot September 3, 2026 07:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The Settings daily-usage-ping row construction still triggers Experiments.setTelemetrySetting indirectly via SendDataSetting, which can incorrectly disable experiments telemetry when the daily ping is toggled off.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fixes FXIOS-16737 where opting out of “Send technical and interaction data” during Terms of Use onboarding unintentionally disabled the Daily Usage Ping due to sendDailyUsagePing falling back to sendUsageData. The change makes the Daily Usage Ping read only its own preference and uses a single shared default value.

Changes:

  • Remove the prefSendDailyUsagePing fallback-to-prefSendUsageData logic in TelemetryWrapper.initGlean and centralize the default behavior.
  • Add AppConstants.defaultSendDailyUsagePing and use it in both telemetry resolution and the Settings toggle row.
  • Add unit tests covering the daily usage ping preference resolution, and reorder test setup to avoid Nimbus/Experiments initialization crashes.
File summaries
File Description
firefox-ios/firefox-ios-tests/Tests/ClientTests/TelemetryWrapperTests.swift Reorders setup and adds unit tests for daily usage ping pref behavior.
firefox-ios/Client/Telemetry/TelemetryWrapper.swift Removes fallback logic and introduces shouldSendDailyUsagePing(prefs:) resolver.
firefox-ios/Client/Frontend/Settings/Main/AppSettingsTableViewController.swift Uses centralized default for the daily usage ping setting row.
BrowserKit/Sources/Common/Constants/AppConstants.swift Adds defaultSendDailyUsagePing constant for shared default behavior.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 281 to 285
let sendDailyUsagePingSettings = SendDataSetting(
prefs: profile.prefs,
prefKey: AppConstants.prefSendDailyUsagePing,
defaultValue: true,
defaultValue: AppConstants.defaultSendDailyUsagePing,
titleText: .SendDailyUsagePingSettingTitle,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 114cd43: every non-studies row was writing its own pref to the global flag and the last one constructed won, so crash reports reset the Nimbus identifiers and technical data got silently overwritten. The call now happens once, at the technical data site.


let result = TelemetryWrapper().shouldSendDailyUsagePing(prefs: prefs)

XCTAssertTrue(result, "Opting out of technical data must not disable the daily usage ping")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Keeping XCTAssertTrue here, since the point of the test is that the ping stays on when technical data is off, and comparing against the constant would keep it green even if the default flipped.

…t telemetry flag

SendDataSetting.init pushed its own pref into Experiments.setTelemetrySetting for
every non-studies instance, so the last row constructed won. Turning off crash
reports reset the Nimbus telemetry identifiers, and turning off technical data was
overwritten by the crash reports row defaulting to true.

The call now happens once, at the technical data site.
}
sendTechnicalDataSetting = sendTechnicalDataSettings

// Technical data is the only setting that may drive experiment participation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This isn't really right. updateExperimentParticipation() requires both studies and telemetry, and rollouts drives participation separately. Maybe this can say somethnig like "the only setting that drives the Nimbus telemetry setting."

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.

4 participants