Closes #26502: add isLocal parameter for history openItem telemetry event

This commit is contained in:
mike a 2022-08-18 12:35:44 -07:00 committed by mergify[bot]
parent 4bb0e68d29
commit 3434c702de
5 changed files with 17 additions and 6 deletions

View File

@ -3041,17 +3041,23 @@ history:
type: event type: event
description: | description: |
A user opened a history item A user opened a history item
extra_keys:
is_remote:
type: boolean
description: |
True if the history item is synced from other devices otherwise false.
bugs: bugs:
- https://github.com/mozilla-mobile/fenix/issues/18178 - https://github.com/mozilla-mobile/fenix/issues/18178
data_reviews: data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/18261 - https://github.com/mozilla-mobile/fenix/pull/18261
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/21038#issuecomment-906757301 - https://github.com/mozilla-mobile/fenix/pull/21038#issuecomment-906757301
- https://github.com/mozilla-mobile/fenix/pull/26503#issuecomment-1219761407
data_sensitivity: data_sensitivity:
- interaction - interaction
notification_emails: notification_emails:
- android-probes@mozilla.com - android-probes@mozilla.com
- erichards@mozilla.com - mavduevskiy@mozilla.com
expires: never expires: never
metadata: metadata:
tags: tags:

View File

@ -35,7 +35,8 @@ sealed class HistoryDB {
override val title: String, override val title: String,
val url: String, val url: String,
override val visitedAt: Long, override val visitedAt: Long,
override val selected: Boolean = false override val selected: Boolean = false,
val isRemote: Boolean = false,
) : HistoryDB() ) : HistoryDB()
data class Metadata( data class Metadata(
@ -250,7 +251,8 @@ class DefaultPagedHistoryProvider(
return HistoryDB.Regular( return HistoryDB.Regular(
title = title, title = title,
url = visit.url, url = visit.url,
visitedAt = visit.visitTime visitedAt = visit.visitTime,
isRemote = visit.isRemote
) )
} }
} }

View File

@ -105,5 +105,6 @@ private fun HistoryDB.Regular.positioned(position: Int): History.Regular {
url = this.url, url = this.url,
visitedAt = this.visitedAt, visitedAt = this.visitedAt,
historyTimeGroup = this.historyTimeGroup, historyTimeGroup = this.historyTimeGroup,
isRemote = this.isRemote
) )
} }

View File

@ -68,7 +68,7 @@ class HistoryFragment : LibraryPageFragment<History>(), UserInteractionHandler {
) { ) {
HistoryDataSource( HistoryDataSource(
historyProvider = historyProvider, historyProvider = historyProvider,
isRemote = if (FeatureFlags.showSyncedHistory) false else null isRemote = null
) )
}.flow }.flow
@ -334,7 +334,7 @@ class HistoryFragment : LibraryPageFragment<History>(), UserInteractionHandler {
} }
private fun openItem(item: History.Regular) { private fun openItem(item: History.Regular) {
GleanHistory.openedItem.record(NoExtras()) GleanHistory.openedItem.record(GleanHistory.OpenedItemExtra(item.isRemote))
(activity as HomeActivity).openToBrowserAndLoad( (activity as HomeActivity).openToBrowserAndLoad(
searchTermOrURL = item.url, searchTermOrURL = item.url,

View File

@ -32,6 +32,7 @@ sealed class History : Parcelable {
* @property visitedAt Timestamp of when this history item was visited. * @property visitedAt Timestamp of when this history item was visited.
* @property historyTimeGroup [HistoryItemTimeGroup] of the history item. * @property historyTimeGroup [HistoryItemTimeGroup] of the history item.
* @property selected Whether or not the history item is selected. * @property selected Whether or not the history item is selected.
* @property isRemote A history item is either opened locally or synced from other devices.
*/ */
@Parcelize @Parcelize
data class Regular( data class Regular(
@ -40,7 +41,8 @@ sealed class History : Parcelable {
val url: String, val url: String,
override val visitedAt: Long, override val visitedAt: Long,
override val historyTimeGroup: HistoryItemTimeGroup, override val historyTimeGroup: HistoryItemTimeGroup,
override val selected: Boolean = false override val selected: Boolean = false,
val isRemote: Boolean = false,
) : History() ) : History()
/** /**