Skip to content

fix: remove file/line leak from error responses and add debug dump - #3511

Closed
TheTisiboth wants to merge 2 commits into
feat/enhance-import-loggingfrom
feat/import-debug-dump-and-leak-fix
Closed

TheTisiboth wants to merge 2 commits into
feat/enhance-import-loggingfrom
feat/import-debug-dump-and-leak-fix

Conversation

@TheTisiboth

Copy link
Copy Markdown
Collaborator

Topic and Scope

Stacked on #3510. Addresses #3279.

  • Remove file/line from JSON error responses in update() and create() — these leak server internals to the client
  • On extraction failure, dump first 8KB of downloaded HTML at debug log level for admin inspection

Formal requirements

  • I did check that the app can still be opened and does not throw any browser logs
  • I created tests for newly added PHP code (check this if no PHP changes were made)
  • I updated the OpenAPI specs and added an entry to the API changelog (check if API was not modified)
  • I notified the matrix channel if I introduced an API change

Note

This PR was created with the assistance of AI tools.
Assisted-by: Claude Code (claude-opus-4-6)

🤖 Generated with Claude Code

TheTisiboth and others added 2 commits October 26, 2026 20:38
Add structured logging throughout the recipe import pipeline:
- Tag ImportExceptions with a step property (download/parse_html/extract_recipe)
- Log per-parser failures with reasons in RecipeExtractionService
- Add debug logs in HTML parsers (JSON-LD element count, decode errors, microdata itemscope count)
- Log HTTP status, content-type, and response size after download
- Return structured {msg, step} error responses from the import API
- Catch generic exceptions as HTTP 500 with safe translated message

Assisted-by: Claude Code (claude-opus-4-6)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Léo Jan <leo.jan@doctolib.com>
Remove internal file paths and line numbers from JSON error responses
in update() and create() endpoints — these leak server internals to
the client. Return only {msg} consistently.

On extraction failure, dump the first 8KB of downloaded HTML at debug
log level so admins can inspect what was fetched.

Assisted-by: Claude Code (claude-opus-4-6)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Léo Jan <leo.jan@doctolib.com>
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

   12 files  ±0    600 suites  ±0   3m 11s ⏱️ +30s
  605 tests ±0    597 ✅ ±0   8 💤 ±0  0 ❌ ±0 
2 420 runs  ±0  2 387 ✅ ±0  33 💤 ±0  0 ❌ ±0 

Results for commit c2e6413. ± Comparison against base commit 8efea9f.

@TheTisiboth
TheTisiboth force-pushed the feat/enhance-import-logging branch from 8efea9f to e3dc968 Compare October 26, 2026 21:55
@TheTisiboth
TheTisiboth deleted the feat/import-debug-dump-and-leak-fix branch October 26, 2026 21:55
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.

1 participant