-
-
Notifications
You must be signed in to change notification settings - Fork 27
refactor(sentry): remove redundant Integration::flushEvents() calls from defer callbacks #1054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -337,9 +337,6 @@ protected function handleRequestReceived(HttpEvent\RequestReceived|RpcEvent\Requ | |||||||||||
|
|
||||||||||||
| // Finish transaction | ||||||||||||
| $transaction->finish(); | ||||||||||||
|
|
||||||||||||
| // Flush events | ||||||||||||
| Integration::flushEvents(); | ||||||||||||
| }); | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
|
Comment on lines
337
to
342
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Removing 🔍 Detailed AnalysisThe refactoring centralizes event flushing into 💡 Suggested FixRestore the 🤖 Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. |
||||||||||||
|
|
@@ -538,9 +535,6 @@ protected function handleCrontabTaskStarting(CrontabEvent\BeforeExecute $event): | |||||||||||
|
|
||||||||||||
| // Finish transaction | ||||||||||||
| $transaction->finish(); | ||||||||||||
|
||||||||||||
| $transaction->finish(); | |
| $transaction->finish(); | |
| // Flush Sentry events generated during crontab task execution | |
| Integration::flushEvents(); |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of Integration::flushEvents() from this defer callback is incorrect. This defer callback handles AMQP message processing lifecycles, which are completely separate from command execution lifecycles. The Integration::flushEvents() in handleCommandFinished's finally block (line 457) only executes for CommandEvent\AfterExecute events (CLI commands), not for AMQP message consumption.
Without this flush call, Sentry events generated during AMQP message processing will not be sent to Sentry, resulting in data loss. The flush call must be restored here.
| $transaction->finish(); | |
| $transaction->finish(); | |
| // Flush Sentry events generated during AMQP message processing | |
| Integration::flushEvents(); |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of Integration::flushEvents() from this defer callback is incorrect. This defer callback handles Kafka message processing lifecycles, which are completely separate from command execution lifecycles. The Integration::flushEvents() in handleCommandFinished's finally block (line 457) only executes for CommandEvent\AfterExecute events (CLI commands), not for Kafka message consumption.
Without this flush call, Sentry events generated during Kafka message processing will not be sent to Sentry, resulting in data loss. The flush call must be restored here.
| $transaction->finish(); | |
| $transaction->finish(); | |
| // Flush Sentry events generated during Kafka message processing | |
| Integration::flushEvents(); |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of Integration::flushEvents() from this defer callback is incorrect. This defer callback handles async queue job processing lifecycles, which are completely separate from command execution lifecycles. The Integration::flushEvents() in handleCommandFinished's finally block (line 457) only executes for CommandEvent\AfterExecute events (CLI commands), not for async queue job processing.
Without this flush call, Sentry events generated during async queue job processing will not be sent to Sentry, resulting in data loss. The flush call must be restored here.
| $transaction->finish(); | |
| $transaction->finish(); | |
| // Flush Sentry events generated during async queue job processing | |
| Integration::flushEvents(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of
Integration::flushEvents()from this defer callback is incorrect. This defer callback handles HTTP and RPC request lifecycles, which are completely separate from command execution lifecycles. TheIntegration::flushEvents()inhandleCommandFinished's finally block (line 457) only executes for CommandEvent\AfterExecute events (CLI commands), not for HTTP/RPC requests.Without this flush call, Sentry events generated during HTTP/RPC request handling will not be sent to Sentry, resulting in data loss. The flush call must be restored here.