feat(diagnostics): correlate staff operations errors and audit records
CI / check (push) Successful in 56s
CI / deploy (push) Successful in 19s
CI / publish-container (push) Successful in 1m15s

This commit is contained in:
Simo committed 2026-09-11 00:34:49 +02:00
1 parent 440ce4e556
commit a2954e4408
14 files changed
+473 -110

No files matched your search

+17
View File
@@ -58,3 +58,20 @@ it("creates only recognized local operation links", () => {
])
expect(errorOperationLink({ ...base, context: { path } })).toBeNull();
});
it("links server operation IDs to the audit search without trusting browser IDs", () => {
const record = createErrorRecord("server", "test", "failed", {
operationId: "op-123",
});
expect(summarizeErrorGroup([record]).auditLink).toBe(
"/admin/logs/audit?search=op-123",
);
expect(
summarizeErrorGroup([{ ...record, source: "browser" }]).auditLink,
).toBeNull();
expect(
summarizeErrorGroup([
{ ...record, context: { operationId: "../../secrets" } },
]).auditLink,
).toBeNull();
});