(traceId: string)
| 145 | |
| 146 | /** Find the structured operator report by the ID returned to the caller. */ |
| 147 | const reportFor = (traceId: string) => |
| 148 | Effect.sync(() => { |
| 149 | for (const line of readServerLog().split("\n")) { |
| 150 | if (!line.startsWith("{")) continue; |
| 151 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: mixed stdout includes non-JSON records |
| 152 | try { |
| 153 | const report = decodeReport(JSON.parse(line)); |
| 154 | if (report._tag === "Some" && report.value.sentry_event_id === traceId) { |
| 155 | return { |
| 156 | headline: JSON.stringify(report.value.tags), |
| 157 | full: line, |
| 158 | tags: report.value.tags, |
| 159 | }; |
| 160 | } |
| 161 | } catch { |
| 162 | /* Other stdout records are not diagnostic envelopes. */ |
| 163 | } |
| 164 | } |
| 165 | return undefined; |
| 166 | }).pipe( |
| 167 | Effect.filterOrFail( |
| 168 | (report) => report !== undefined, |
| 169 | () => `no error report joined to trace id ${traceId} in the server log`, |
| 170 | ), |
| 171 | Effect.retry(Schedule.both(Schedule.spaced("500 millis"), Schedule.recurs(40))), |
| 172 | ); |
| 173 | |
| 174 | scenario( |
| 175 | "Storage · a rejected write is reported without its SQL or the caller's data", |
no test coverage detected