Found in PR #80 (fix/71-remove-pii-logging)
Severity: Major
While removing PII-containing console.log calls, the error variables from two DB updates were also dropped, making DB failures completely silent:
Path 1 — status-only update (change_id not found in docx):
// Before: const { error: updErr } = await db... console.log('status-only update', { updErr })
// After:
await db
.from("document_edits")
.update({ status: ..., resolved_at: ... })
.eq("id", editId);
// Error completely ignored — if this fails, we return ok:true with stale DB state
Path 2 — main status update (after file overwrite):
// Before: const { error: statusErr } = await db... console.log('updated status', { statusErr })
// After:
await db
.from("document_edits")
.update({ status: ..., resolved_at: ... })
.eq("id", editId);
// Error completely ignored
If either DB update fails (network blip, RLS policy, constraint), the handler returns { ok: true } while the edit remains in pending state in the database. The UI will show the edit as resolved when it isn't.
Fix: Restore the error destructuring without the console.log:
const { error: updErr } = await db.from("document_edits").update(...).eq("id", editId);
if (updErr) {
console.error("[edit-resolution] failed to update edit status", { error: updErr.message });
return void res.status(500).json({ detail: "Failed to save resolution" });
}
The console.error is acceptable — the issue only prohibits PII at INFO level. An opaque error message without IDs is safe.
Found in PR #80 (fix/71-remove-pii-logging)
Severity: Major
While removing PII-containing
console.logcalls, the error variables from two DB updates were also dropped, making DB failures completely silent:Path 1 — status-only update (change_id not found in docx):
Path 2 — main status update (after file overwrite):
If either DB update fails (network blip, RLS policy, constraint), the handler returns
{ ok: true }while the edit remains inpendingstate in the database. The UI will show the edit as resolved when it isn't.Fix: Restore the error destructuring without the console.log:
The
console.erroris acceptable — the issue only prohibits PII at INFO level. An opaque error message without IDs is safe.