Commit f21fd62
CMM-1998: Add application password prompt and creation analytics events (#22750)
* Add application password analytics events for migration, creation, and reauth flows
Add three new analytics events to match iOS parity:
- application_password_migration_prompted: tracked when the migration prompt is shown, with source property
- application_password_created: tracked on credential storage success/failure, with source, success, and error properties
- application_password_reauth_prompted: tracked when the re-authentication prompt is shown
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Extract creation source tracking into ApplicationPasswordCreationTracker singleton
Move the pending creation source state from ApplicationPasswordLoginActivity
companion object into a dedicated singleton. This bridges the source value
across the Chrome Custom Tab flow and supports distinct sources: login,
auto_migration, migration, and reauth.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix false application_password_storing_failed on new site login
Replace Boolean return from storeApplicationPasswordCredentialsFrom()
with a sealed class (Success, SiteNotFound, BadData) so callers can
distinguish the expected "site not found locally" case from genuine
failures. SiteNotFound no longer fires storing_failed tracking or
Sentry reports since it is the normal path for new sites that need
to be fetched first.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix double application_password_created tracking on reauth
The updateApplicationPassword dispatch triggers onSiteChanged via
EventBus, causing a second tracking event. Pass creationSource to the
helper so it tracks on the Success path, and add a
credentialsAlreadyStored guard so onSiteChanged is ignored when
credentials were already stored directly (reauth flow).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix double tracking of prompted events on activity recreation
Guard analytics tracking in onCreate with savedInstanceState == null
so events only fire on the initial creation, not on configuration
changes or activity recreation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix race condition causing double application_password_created on reauth
Replace credentialsAlreadyStored flag (set after coroutine returns,
too late) with a volatile waitingForFetchedSite flag that is only set
in the SiteNotFound path. This ensures onSiteChanged events from
updateApplicationPassword are ignored — they only matter when we
dispatched fetchSites for a new site.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Emit navigation event on successful credential storage for existing sites
The Success branch was missing a navigation emit after blocking
onSiteChanged, causing the reauth flow to hang indefinitely.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Use migration source when auto-creation falls back to manual webview
When auto-creation fails and the user completes the flow via the
webview, the source should be "migration" (manual) not
"auto_migration", since the password was created manually.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add tests for existing site credential storage and onSiteChanged guard
- Test that Success emits navigation without site selector
- Test that onSiteChanged is ignored after direct credential storage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add @volatile to CreationTracker and propagate creationSource in exception handler
- Mark pendingCreationSource as @volatile for thread safety
- Pass creationSource to trackStoringFailed in the storeCredentials
exception handler so the created-failure event fires on that path
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix review issues: feature_name key, atomic tracker, and source constants
- Fix migration_prompted event property key from "source" to
"feature_name" to match iOS schema
- Replace @volatile with AtomicReference in CreationTracker for
atomic consume operation
- Extract creation source magic strings into constants on
ApplicationPasswordCreationTracker
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Extract observeNavigationEvents to fix LongMethod detekt warning
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Remove empty line before closing brace in ApplicationPasswordLoginActivity
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 32f7759 commit f21fd62
12 files changed
Lines changed: 390 additions & 133 deletions
File tree
- WordPress/src
- main/java/org/wordpress/android/ui/accounts
- applicationpassword
- login
- applicationpassword
- test/java/org/wordpress/android/ui/accounts
- applicationpassword
- login
- applicationpassword
- libs/analytics/src/main/java/org/wordpress/android/analytics
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
Lines changed: 61 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| 50 | + | |
| 51 | + | |
47 | 52 | | |
48 | 53 | | |
| 54 | + | |
| 55 | + | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| |||
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
71 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
75 | 84 | | |
76 | 85 | | |
77 | 86 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
87 | 114 | | |
88 | 115 | | |
89 | 116 | | |
90 | 117 | | |
91 | 118 | | |
92 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
93 | 122 | | |
94 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
95 | 127 | | |
96 | 128 | | |
97 | 129 | | |
98 | | - | |
| 130 | + | |
| 131 | + | |
99 | 132 | | |
100 | 133 | | |
101 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
102 | 137 | | |
103 | 138 | | |
104 | | - | |
| 139 | + | |
105 | 140 | | |
106 | 141 | | |
107 | 142 | | |
| |||
123 | 158 | | |
124 | 159 | | |
125 | 160 | | |
126 | | - | |
| 161 | + | |
127 | 162 | | |
128 | 163 | | |
129 | 164 | | |
| |||
149 | 184 | | |
150 | 185 | | |
151 | 186 | | |
152 | | - | |
| 187 | + | |
153 | 188 | | |
154 | 189 | | |
155 | 190 | | |
| |||
177 | 212 | | |
178 | 213 | | |
179 | 214 | | |
| 215 | + | |
180 | 216 | | |
181 | 217 | | |
182 | 218 | | |
| |||
195 | 231 | | |
196 | 232 | | |
197 | 233 | | |
198 | | - | |
| 234 | + | |
| 235 | + | |
199 | 236 | | |
200 | 237 | | |
201 | 238 | | |
| |||
230 | 267 | | |
231 | 268 | | |
232 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
233 | 274 | | |
234 | 275 | | |
235 | 276 | | |
| |||
280 | 321 | | |
281 | 322 | | |
282 | 323 | | |
283 | | - | |
| 324 | + | |
| 325 | + | |
284 | 326 | | |
285 | 327 | | |
286 | 328 | | |
| |||
Lines changed: 52 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
95 | 103 | | |
96 | 104 | | |
97 | | - | |
98 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
99 | 108 | | |
100 | 109 | | |
101 | 110 | | |
102 | 111 | | |
103 | 112 | | |
104 | 113 | | |
105 | | - | |
106 | | - | |
| 114 | + | |
| 115 | + | |
107 | 116 | | |
108 | 117 | | |
109 | 118 | | |
| |||
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
126 | | - | |
127 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
128 | 138 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 139 | + | |
| 140 | + | |
133 | 141 | | |
134 | 142 | | |
135 | 143 | | |
136 | 144 | | |
137 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
138 | 150 | | |
139 | 151 | | |
140 | 152 | | |
141 | 153 | | |
142 | 154 | | |
143 | 155 | | |
144 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
145 | 177 | | |
146 | 178 | | |
147 | 179 | | |
| |||
154 | 186 | | |
155 | 187 | | |
156 | 188 | | |
157 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
158 | 193 | | |
159 | 194 | | |
160 | 195 | | |
| |||
168 | 203 | | |
169 | 204 | | |
170 | 205 | | |
171 | | - | |
| 206 | + | |
172 | 207 | | |
173 | 208 | | |
174 | 209 | | |
175 | | - | |
| 210 | + | |
176 | 211 | | |
177 | 212 | | |
178 | 213 | | |
179 | 214 | | |
180 | 215 | | |
181 | 216 | | |
182 | 217 | | |
183 | | - | |
| 218 | + | |
184 | 219 | | |
185 | | - | |
186 | | - | |
| 220 | + | |
| 221 | + | |
187 | 222 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | 223 | | |
195 | 224 | | |
196 | 225 | | |
| |||
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
| |||
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
106 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
107 | 116 | | |
108 | 117 | | |
109 | 118 | | |
| |||
0 commit comments