fix: remove PII console.log from edit-resolution handler

🟢 open · #80 · willchen96/mike ← bmersereau/mike · opened 14d ago by bmersereau · +1,328-57 across 7 files · ↗ on GitHub

From the PR description

Summary

  • Removed all console.log calls from the handleEditResolution handler that emitted userId, documentId, editId, and internal state at INFO level
  • These were written during development; in production they link user identities to legal document activity in any log aggregator, conflicting with data minimization under GDPR
  • console.error calls in other handlers (storage, conversion) are untouched - those are genuine failure signals
  • Also excludes src/**/__tests__/** from TypeScript compilation so test-only ESM syntax doesn't break the build
  • Restores error handling for both document_edits UPDATE calls that were silently swallowed after log removal
  • Fixes test isolation (was searching for wrong function name resolveEditHandler, now correctly targets handleEditResolution)

Closes #71 Closes #86 Closes #94

Changes

  • backend/src/routes/documents.ts - all console.log statements removed from handleEditResolution; DB error handling restored for both UPDATE calls
  • backend/tsconfig.json - test directories excluded from tsc include
  • backend/src/lib/__tests__/editResolutionLogging.test.ts - 3 static-analysis tests verifying no PII in handler source; function name corrected

Test plan

  • Static analysis tests: no console.log with userId/editId/documentId in handler
  • Build and typecheck pass

Our analysis

Strip PII from edit-resolution logs for GDPR data minimization — read the full analysis →

Think the analysis missed something the PR description covers?

Capture this PR into my fork

Download a Markdown prompt that tells Claude how to port every commit in this PR into your working tree. Run it via claude -p < capture-pull-80.md from inside the repo you want the changes in.

⬇ Download capture-pull-80.md