Commit 378a885
committed
fix: address multi-model review findings in App Insights telemetry
- Remove disableCookiesUsage: true — was silently breaking cross-session
anonymous user analytics (every tab = new user ID). Consented users now
correctly persist ai_user across sessions.
- onConsentRevoked() explicitly deletes ai_user/ai_session cookies on every
page load, unconditionally (not guarded on appInsights init). Covers the
critical case: returning visitor with stale cookies from a prior consented
session who then denied consent and closed the browser.
- Fix setAuthenticatedContext() no-op: call instance.setAuthenticatedUserContext()
directly in createAppInsights() instead of via module-level guard which was
always null at that point.
- Reset sdkLoadPromise=null on onerror to allow retry on transient CDN failure.
- Add 15s timeout in ensureSdkLoaded() when attaching to existing script tag
to prevent hang if script already errored before listeners were attached.
- Add ai_user/ai_session to consent-manager clearTrackingCookies() as
defense-in-depth for the 'forget me' revocation path.
Reviewed and approved by Opus 4.6 and GPT-5.5.1 parent daebe95 commit 378a885
2 files changed
Lines changed: 41 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
64 | 74 | | |
65 | 75 | | |
66 | 76 | | |
| |||
69 | 79 | | |
70 | 80 | | |
71 | 81 | | |
72 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
73 | 86 | | |
74 | 87 | | |
75 | 88 | | |
| |||
94 | 107 | | |
95 | 108 | | |
96 | 109 | | |
97 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
98 | 117 | | |
99 | 118 | | |
100 | 119 | | |
| |||
126 | 145 | | |
127 | 146 | | |
128 | 147 | | |
129 | | - | |
130 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
131 | 151 | | |
132 | 152 | | |
133 | | - | |
134 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
135 | 166 | | |
136 | 167 | | |
137 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
453 | | - | |
454 | | - | |
| 453 | + | |
| 454 | + | |
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| |||
0 commit comments