Skip to content

Add route after-response callbacks - #175

Merged
eviltester merged 1 commit into
masterfrom
codex/174-after-response-hooks
Aug 26, 2026
Merged

Add route after-response callbacks#175
eviltester merged 1 commit into
masterfrom
codex/174-after-response-hooks

Conversation

@eviltester

Copy link
Copy Markdown
Owner

Closes #174

Summary

  • Add route-level afterResponse callbacks that run after final response rendering and before legacy/global HTTP response hooks.
  • Expose the final status, headers, content type, optional body, public route, resolved target entity/identifier, principal, and data scope to observational callbacks.
  • Log and preserve the already-produced response when an after-response callback throws.
  • Attach source and Javadoc jars during normal Maven package/install builds.

Verification

  • Full Maven verification passed via the commit hook across all modules.
  • mvn -q clean install also passed locally and installed the updated snapshot, sources, and Javadocs to Maven local.

Copilot AI lite review requested due to automatic review settings August 26, 2026 10:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@eviltester
eviltester merged commit 77d2b0b into master Aug 26, 2026
3 checks passed
@eviltester
eviltester deleted the codex/174-after-response-hooks branch August 26, 2026 10:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5937418cad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +105 to +106
public ApiResponse apiResponse() {
return apiResponse;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return a read-only structured response snapshot

When an observational callback calls response.apiResponse().withStatusCode(...), setBody(...), or clearBody(), it mutates the same ApiResponse referenced by the returned HttpApiResponse; that class delegates status and body rendering to this object. The callback can therefore alter the caller-visible response despite this API being documented as immutable/read-only and preserving the already-rendered response. Expose a defensive/read-only representation instead of the mutable underlying object.

Useful? React with 👍 / 👎.

Comment on lines +299 to +301
httpResponse =
runRouteAfterResponseCallbacksOn(
request, httpResponse, effectiveVerb, lifecycle, parsedEnvelope);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply callbacks to the legacy query response path

When callers use the public query(HttpApiRequest, String) helper instead of queryRequest, execution never reaches this callback phase: that helper renders its GET response and returns directly through the legacy response hooks. Consequently, an afterResponse callback registered on the queried GET route silently does not run depending on which public HTTP entry point is used. Route this helper through the common response pipeline or explicitly invoke the new callback phase there.

Useful? React with 👍 / 👎.

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.

Route-Level Final Response Hooks

2 participants