You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: autofill/autofill-impl/src/main/java/com/duckduckgo/autofill/impl/engagement/EngagementPasswordAddedListener.kt
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,15 @@ class EngagementPasswordAddedListener @Inject constructor(
38
38
privatevalpixel:Pixel,
39
39
) : PasswordStoreEventListener {
40
40
41
+
// keep in-memory state to avoid sending the pixel multiple times if called repeatedly in a short time
42
+
privatevar credentialAdded =false
43
+
44
+
@Synchronized
41
45
overridefunonCredentialAdded(id:Long) {
46
+
if (credentialAdded) return
47
+
48
+
credentialAdded =true
49
+
42
50
appCoroutineScope.launch(dispatchers.io()) {
43
51
val daysInstalled = userBrowserProperties.daysSinceInstalled()
Copy file name to clipboardExpand all lines: autofill/autofill-impl/src/test/java/com/duckduckgo/autofill/impl/engagement/EngagementPasswordAddedListenerTest.kt
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ class EngagementPasswordAddedListenerTest {
0 commit comments