Skip to content

Fix failure capture, redaction and snapshot resilience - #3

Merged
leonidtimo17 merged 1 commit into
mainfrom
fix/capture-pipeline-and-redaction
Aug 21, 2026
Merged

Fix failure capture, redaction and snapshot resilience#3
leonidtimo17 merged 1 commit into
mainfrom
fix/capture-pipeline-and-redaction

Conversation

@leonidtimo17

Copy link
Copy Markdown
Owner

Failed requests were never captured while the application exception handler was active. Illuminate\Routing\Pipeline renders throwables into responses before they reach global middleware, so the middleware catch block was only reachable under withoutExceptionHandling(), which is exactly what the test suite used. Capture now reads the throwable that Pipeline attaches to the rendered response, with a renderable() hook as a secondary path and deduplication through the request attribute.

Other fixes:

  • timecode:replay passed an explicit false when --auth was absent, so replay.restore_auth_user never applied.
  • Truncated strings carried a literal \n instead of a newline, and were cut mid-character, producing invalid UTF-8 that made the whole snapshot fail to encode.
  • timecode:list failed outright when a single snapshot was unreadable, for example after an APP_KEY rotation. Such files are now skipped and reported to the log.
  • The service provider threw when no HTTP kernel was bound.

ignore_exceptions now also lists AuthorizationException, RecordsNotFoundException and TokenMismatchException. Capture sees the original throwable rather than the one Laravel maps it to, so 403, 404 and 419 responses were recorded despite the intent of the defaults.

Verified against a fresh Laravel 13.26.1 application on PHP 8.5.

Failed requests were never captured while the application exception
handler was active. Illuminate\Routing\Pipeline renders throwables into
responses before they reach global middleware, so the middleware catch
block was only reachable under withoutExceptionHandling(), which is
exactly what the test suite used. Capture now reads the throwable that
Pipeline attaches to the rendered response, with a renderable() hook as
a secondary path and deduplication through the request attribute.

Other fixes:

- timecode:replay passed an explicit false when --auth was absent, so
  replay.restore_auth_user never applied.
- Truncated strings carried a literal \n instead of a newline, and were
  cut mid-character, producing invalid UTF-8 that made the whole
  snapshot fail to encode.
- timecode:list failed outright when a single snapshot was unreadable,
  for example after an APP_KEY rotation. Such files are now skipped and
  reported to the log.
- The service provider threw when no HTTP kernel was bound.

ignore_exceptions now also lists AuthorizationException,
RecordsNotFoundException and TokenMismatchException. Capture sees the
original throwable rather than the one Laravel maps it to, so 403, 404
and 419 responses were recorded despite the intent of the defaults.

Verified against a fresh Laravel 13.26.1 application on PHP 8.5.
@leonidtimo17
leonidtimo17 merged commit 0a79bdb into main Aug 21, 2026
10 checks passed
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