Skip to content

Harden response lifecycle consistency and add lifecycle regression coverage#280

Merged
techmahedy merged 2 commits intodoppar:3.xfrom
techmahedy:techmahedy-3.x
May 6, 2026
Merged

Harden response lifecycle consistency and add lifecycle regression coverage#280
techmahedy merged 2 commits intodoppar:3.xfrom
techmahedy:techmahedy-3.x

Conversation

@techmahedy
Copy link
Copy Markdown
Member

This PR tightens Doppar’s request/response lifecycle so response semantics stay consistent across normal, redirect, JSON, view, and error flows.

What changed

  1. Made redirect responses consistently store the final target URL in original
  2. Kept view responses semantic by storing ['view' => ..., 'data' => ...] in original
  3. Kept production web error responses tied to the triggering exception in original
  4. Fixed the redirect() helper to always return a fresh RedirectResponse instance instead of reusing a stale resolved redirect singleton
  5. Added a focused lifecycle regression suite covering controller JSON, helper JSON, HEAD handling, abort JSON responses, validation redirect responses, and stale instance leakage checks.

Why

The framework already had the right high-level lifecycle shape, but some response branches were still inconsistent about:

  1. what goes into original
  2. whether helpers reuse stale response instances
  3. whether equivalent response paths behave the same under preparation and error handling

This PR makes those paths behave more predictably and adds regression coverage around the lifecycle edges that were easiest to break.

@techmahedy techmahedy merged commit 2075e05 into doppar:3.x May 6, 2026
27 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