Skip to content

Conversation

@AdaInTheLab
Copy link
Owner

🐛 What this PR fixes

This PR resolves a bug where the /lab-notes route could send multiple responses for a single request.

The issue was caused by two consecutive res.json(...) calls inside the same handler, which led to:

  • Cannot set headers after they are sent to the client errors
  • Noisy test output
  • Risky runtime behavior under load

🛠️ What changed

  • Removed the duplicate res.json(notes) call
  • Ensured the handler returns immediately after sending a response
  • Left existing error handling intact, with headersSent protection

✅ Result

  • One request → one response
  • Clean test runs
  • No more header-sending conflicts
  • Calmer logs, safer runtime behavior

🦊✨ Quiet correctness restored.

- Remove duplicate res.json call in /lab-notes handler
- Ensure handler returns after sending response
- Eliminate "Cannot set headers after they are sent" errors
- Stabilize test output and runtime behavior

co-authored-by: Lyric <lyric@thehumanpatternlab.com>
co-authored-by: Carmel <carmel@thehumanpatternlab.com>
@AdaInTheLab AdaInTheLab merged commit 7cdc535 into main Dec 29, 2025
1 check passed
@AdaInTheLab AdaInTheLab deleted the fix/lab-notes-double-response branch December 29, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants