brave / brave-ios

Brave iOS Browser
https://brave.com
Mozilla Public License 2.0
1.7k stars 441 forks source link

Fix #8673: Move NTP P3A helper creation outside of NTP #8676

Closed kylehickinson closed 8 months ago

kylehickinson commented 8 months ago

There was a chance that a user would simply never load a NTP during their session which means that P3A rotations wouldn't trigger new NTP-SI reports each day. This report was supposed to occur each rotation, not specifically per NTP view.

Summary of Changes

This pull request fixes #8673

Submitter Checklist:

Test Plan:

  1. Prefix: Visit debug settings > BraveCore Switches and set express rotation interval of some short amount (and optionally do not randomize)
  2. Load app as usual, view a NTP-SI and verify it reports correctly
  3. Load a website in the current tab and kill the app
  4. Re-open the app and do not visit any NTP (including non-SI versions), verify NTP-SI data is still reported correctly

Reviewer Checklist: