Commit 51c16dc
fix(core): Inject replayId into trace context for buffer mode errors
In buffer mode, the scope's replayId is empty until captureReplay()
is called. But the event's trace context is built from the
transaction's frozen baggage, which was frozen before captureReplay()
set the replayId. This means error events that trigger a buffer
replay flush are never linked to the replay.
After captureReplay() runs, check if the scope has a replayId that
the trace context is missing and inject it via a new withReplayId
copy method on TraceContext.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent a979f23 commit 51c16dc
3 files changed
Lines changed: 29 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4567 | 4567 | | |
4568 | 4568 | | |
4569 | 4569 | | |
| 4570 | + | |
4570 | 4571 | | |
4571 | 4572 | | |
4572 | 4573 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
258 | 267 | | |
259 | 268 | | |
260 | 269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
134 | 152 | | |
135 | 153 | | |
136 | 154 | | |
| |||
0 commit comments