Commit 6f7cf13
Drew Stone
fix(trace-store): merge _update span patches on FileSystemTraceStore.load
When a fresh FileSystemTraceStore opens a directory written by a prior
process, load() calls appendSpan() for every NDJSON row — including the
{ ...patch, _update: true } fragments that updateSpan writes. Those
fragments lack kind / runId / name / model, so the reader ended up with
two spans per id (full row + fragment), breaking any consumer that
re-opens the store cross-process (e.g. tax-agent's canonical eval OTLP
converter, which then reported 0 spans to the trace analyst).
The runs branch already handled this via appendRun-then-updateRun
fallback. Mirror the same pattern for spans: detect \_update and route
to updateSpan, merging into the prior span. New regression test reads
the dir from a second FileSystemTraceStore instance and asserts the
patch fields are applied without losing kind / runId / name.1 parent 544fa69 commit 6f7cf13
2 files changed
Lines changed: 50 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
272 | 290 | | |
273 | 291 | | |
274 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
142 | 173 | | |
143 | 174 | | |
144 | 175 | | |
| |||
0 commit comments