fix(events): Debug param wasn't being passed down correctly#116152
Conversation
wmak
commented
May 25, 2026
- on tables the param wasn't being passed to the table_rpc
- on timeseries the debug wasn't being included in the response meta
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 11239c5. Configure here.
| @sentry_sdk.trace | ||
| def run_bulk_table_queries(cls, queries: list[TableQuery]) -> dict[str, EAPResponse]: | ||
| def run_bulk_table_queries( |
There was a problem hiding this comment.
run_bulk_table_queries accepts debug but never forwards it to table_rpc or process_table_response
run_bulk_table_queries in src/sentry/snuba/rpc_dataset_common.py takes a debug: str | bool = False parameter, but neither the snuba_rpc.table_rpc([...]) call nor the per-response cls.process_table_response(...) call inside it receive debug. As a result, callers (e.g. organization_trace_meta.py, organization_ai_conversations.py) that request debug output via the bulk path get no debug_info attached to the response meta and no debug payload attached to raised exceptions, contradicting the PR's intent ("on tables the param wasn't being passed to the table_rpc"). The non-bulk _run_table_query correctly threads debug=debug into both calls, confirming the intended pattern.
Evidence
run_bulk_table_queriessignature at line 431-432 declaresdebug: str | bool = False.- The body at line 449-451 calls
snuba_rpc.table_rpc([...])withoutdebug=debug. - The subsequent dict-comprehension calls
cls.process_table_response(response, request, context=process_context)withoutdebug, soset_debug_meta(gated onif debug:at line 539) never runs for bulk results. - The sibling
_run_table_queryat lines 395 and 406 passesdebug=debugto bothtable_rpcandprocess_table_response, establishing the intended contract.
Identified by Warden sentry-backend-bugs · 45U-PQ9
There was a problem hiding this comment.
Fix attempt detected (commit 3a35ee0)
The signature now accepts debug, but it is still not forwarded to snuba_rpc.table_rpc or cls.process_table_response, so debug_info is still not attached for bulk queries.
The original issue appears unresolved. Please review and try again.
Evaluated by Warden
- on tables the param wasn't being passed to the table_rpc - on timeseries the debug wasn't being included in the response meta
11239c5 to
3a35ee0
Compare
| def run_bulk_table_queries( | ||
| cls, queries: list[TableQuery], debug: str | bool = False | ||
| ) -> dict[str, EAPResponse]: |
There was a problem hiding this comment.
Bug: The debug parameter in run_bulk_table_queries is not used, so passing debug=True will not return any debug information as intended.
Severity: LOW
Suggested Fix
Pass the debug parameter from run_bulk_table_queries to both the snuba_rpc.table_rpc call and the cls.process_table_response call. This will ensure that when debug=True is provided, the debug information is correctly processed and included in the response, matching the behavior of the _run_table_query method.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: src/sentry/snuba/rpc_dataset_common.py#L431-L433
Potential issue: The `run_bulk_table_queries` method was updated to accept a `debug`
parameter, but this parameter is never used within the method's body. Specifically, it
is not passed to the `snuba_rpc.table_rpc` call or the `cls.process_table_response`
call. As a result, any caller attempting to use this feature by passing `debug=True`
will silently receive no debug information in the response, as the logic in
`process_table_response` that sets debug metadata will never be triggered. While current
callers do not use this parameter, the feature is inoperative.
Did we get this right? 👍 / 👎 to inform future reviews.
