Commit 1df660b
authored
fix(browser): Ensure source is set correctly when updating span name in-place in
When using `beforeStartSpan` in `browserTracingIntgration`, we document
that users should return a new options object rather than mutating the
passed in object in-place. However, nothing keeps users from setting the
name in-place like so:'
```js
browserTracingIntegration({
beforeStartSpan: opts => {
opts.name = 'changed';
return opts;
},
}),
```
In such a case, we previously didn't catch the mutation and wouldn't
adjust the span source attribute to `'custom'` accordingly. This PR
ensures we take care of this case, too. (found while writing a test for
#17500)beforeStartSpan (#17501)1 parent 5d9e1bb commit 1df660b
File tree
2 files changed
+40
-2
lines changed- packages/browser
- src/tracing
- test/tracing
2 files changed
+40
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| 359 | + | |
359 | 360 | | |
360 | 361 | | |
361 | 362 | | |
| |||
364 | 365 | | |
365 | 366 | | |
366 | 367 | | |
367 | | - | |
| 368 | + | |
368 | 369 | | |
369 | 370 | | |
370 | 371 | | |
| |||
Lines changed: 38 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
450 | 487 | | |
451 | 488 | | |
452 | 489 | | |
| |||
0 commit comments