This patch fixes two problems:
1) We were treating "direct tab load" as an event which applies
uniformally to all tabs, even though it's actually an event which
happens for a specific tab. This lead to background tabs (pages opened as new tab)
setting the direct load flag, and then a simultaneously loading
parent tab would incorrectly interpret that flag for itself.
The patch switches this tracking from a simple boolean (are we direct
loading?) to a set of tab IDs that are currently direct loading.
2) In a case when a background tab was loading with a parent who's
search terms were cleared by a direct load, we were not trying to
lookup search terms on the background tab's historyMetadata key,
which exists to capture search terms for this exact scenario.
The patch adds an additional fallback lookup for that path.
This moves the group removal logic to the place where the groups are
actually formed. This helps clean-up the fragment code a bit, and
removes the awkward 'allow mutate some random internal state' API from
the provider.
* For #22146 - Added counter for home screen views
* For #22146 - Added PR number to metrics
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Setting this value in FenixApplication.onCreate was buggy because of a race
with restoring BrowserState.
Setting it here would ensure a better granularity of the events and so to more
accurate reporting.
* For #22145 - Added telemetry to the opening screen preference.
* For #22145 - Added PR number to metric
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* For #22298 - Added telemetry to inactive tabs CFR
* For #22298 - added PR issue number to metrics
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>