Repository navigation
fix(rails): capture handled Rails.error reports during web requests - #307
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1eae04866
ℹ️ 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".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@bradleypriest wondering if you are gonna follow up on the comments? thanks for the PR btw |
|
Hey @marandaneto, 2 of the comments were unrelated to this change, and the third (making it a major version bump) seemed a bit overkill, have left comments inline. Thanks! |
|
Both resolved in the latest commit |
marandaneto
left a comment
There was a problem hiding this comment.
The code looks good; no qualifying findings. Verdict: correct.
The web request guard drops handled errors reported through Rails.error because they never reach the exception middleware. Deduplicate successful captures in the core client, including captured causes, so the Rails subscriber, middleware and ActiveJob integration can report the same exception safely. Remove their separate markers and the web request guard.
…nto fix/pr-307-ci-9lrv06
d02dac5 to
50663de
Compare
💡 Motivation and Context
The Rails subscriber currently skips all reports during web requests. Handled errors reported through
Rails.errornever reach the exception middleware, so PostHog loses them.Allow these reports and move duplicate suppression into the core client, replacing the separate Rails and ActiveJob markers and web request flag.
Changed behaviour
false, including explicit manual captures and captures through another client.PostHog::Rails::IN_WEB_REQUEST_KEYand the request-tracking and exception-marker helpers documented as private.Failed captures remain retryable. Frozen exceptions can still be captured but cannot be marked for duplicate suppression.
💚 How did you test it?
📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Developed with Codex using Git, GitHub CLI, RSpec, RuboCop and Changesets.