Commit 4b535bf
committed
fix(core): Defer standalone app start send to avoid duplicate transactions
When appLoaded() is called after auto-capture in standalone mode, two
separate App Start transactions were sent to Sentry for the same launch.
This inflates transaction counts and produces inconsistent app start
metrics on the dashboard.
Fix: in standalone mode, auto-capture from ReactNativeProfiler now defers
the captureStandaloneAppStart() call via setTimeout(0) instead of sending
immediately. This gives appLoaded() a chance to cancel the deferred send
and replace it with a single transaction using the correct manual
timestamp.
If appLoaded() is never called, the deferred send fires on the next tick
and the existing behavior is preserved — only one transaction is sent.
Adds scheduleDeferredStandaloneCapture() and cancelDeferredStandaloneCapture()
methods on the AppStartIntegration type. Adds a test verifying the deferred
send fires when appLoaded() is not called.1 parent 456fa3c commit 4b535bf
File tree
2 files changed
+94
-21
lines changed- packages/core
- src/js/tracing/integrations
- test/tracing/integrations
2 files changed
+94
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
115 | 120 | | |
116 | 121 | | |
117 | 122 | | |
| |||
150 | 155 | | |
151 | 156 | | |
152 | 157 | | |
153 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
154 | 171 | | |
155 | 172 | | |
156 | 173 | | |
| |||
276 | 293 | | |
277 | 294 | | |
278 | 295 | | |
| 296 | + | |
279 | 297 | | |
280 | 298 | | |
281 | 299 | | |
| |||
305 | 323 | | |
306 | 324 | | |
307 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
308 | 330 | | |
309 | 331 | | |
310 | 332 | | |
| |||
629 | 651 | | |
630 | 652 | | |
631 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
632 | 673 | | |
633 | 674 | | |
634 | 675 | | |
635 | 676 | | |
636 | 677 | | |
637 | 678 | | |
638 | 679 | | |
| 680 | + | |
| 681 | + | |
639 | 682 | | |
640 | 683 | | |
641 | 684 | | |
| |||
Lines changed: 50 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1260 | 1260 | | |
1261 | 1261 | | |
1262 | 1262 | | |
1263 | | - | |
| 1263 | + | |
| 1264 | + | |
1264 | 1265 | | |
1265 | 1266 | | |
1266 | 1267 | | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
1273 | | - | |
1274 | 1268 | | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
| 1269 | + | |
| 1270 | + | |
1283 | 1271 | | |
1284 | | - | |
| 1272 | + | |
| 1273 | + | |
1285 | 1274 | | |
1286 | 1275 | | |
1287 | 1276 | | |
1288 | 1277 | | |
1289 | 1278 | | |
1290 | | - | |
1291 | | - | |
1292 | | - | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
1293 | 1282 | | |
1294 | 1283 | | |
1295 | 1284 | | |
1296 | 1285 | | |
1297 | 1286 | | |
1298 | 1287 | | |
1299 | 1288 | | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
1300 | 1330 | | |
1301 | 1331 | | |
1302 | 1332 | | |
| |||
0 commit comments