GLM-5.3 Flash · Balanced

replays-self-serve-bulk-delete-system-sentry

Sentry · Python · M · 100–299 lines · 3 files

The normal review, with one generalist agent. Judge: Claude Opus 5.5.

Gold bugs found
4 of 14
Comments published
5
Comments matching a bug
4
Comments not matching
1
Cost of this PR
$0.510

Published comments (5)

highbugstatic/app/views/dashboards/widgetCard/chart.tsx:164-174

Table widget renders empty data under use-table-widget-visualization flag — Hardcoded empty props silently discard the query results, so every dashboard table widget renders as an empty grid under the flag. Pass the real `result.data` and `result.meta` with derived `columns`, or gate the branch until `TableWidgetVisualization` is actually wired up.

mediumbugsrc/sentry/issues/endpoints/browser_reporting_collector.py:50-60

Truthiness check on sibling field lets timestamp: 0 and age: 0 coexist — Zero is falsy, so a report containing both `timestamp: 0` and `age: 0` passes the mutual-exclusivity check and is accepted and counted. Test presence with `"age" in self.initial_data` in both validators instead of a truthy `get`.

mediumbugsrc/sentry/replays/endpoints/project_replay_summarize_breadcrumbs.py:104-123

Error IDs are paired with wrong event data when nodestore omits missing ids — The Django backend's `get_multi` omits missing ids, so zipping `error_ids` with `events.values()` pairs every later id with the wrong event's data, corrupting titles, timestamps, and the breadcrumb timeline. Look up each id with `events.get(node_id)` instead of zipping the values.

mediumbugsrc/sentry/replays/endpoints/project_replay_summarize_breadcrumbs.py:79-84

Client-controlled field params cause KeyError and drop error_ids from summary — An unknown `?field=` value raises an unhandled `KeyError` for a 500, and omitting `error_ids` silently empties the summary's error context. Stop accepting `field` params on this endpoint, or whitelist known fields instead of projecting blindly.

mediumperformancesrc/sentry/replays/endpoints/project_replay_summarize_breadcrumbs.py:70-77

Snuba query runs even when error context is disabled — Requests that disable error context still pay the cross-service Snuba query, whose result is then discarded. Move the `query_replay_instance` call and `process_raw_response` below the `disable_error_fetching` early-out.

Gold bugs found (4)

mediumThe age/timestamp mutual-exclusion validators check truthiness via initial_data.get(), so a zero value is treated as absent and a report carrying both fields passes validation.
mediumThe Snuba replay lookup for error IDs runs even when enable_error_context=false, adding a needless query (and failure point) to opt-out requests.
highWith the use-table-widget-visualization flag on, the widget renders TableWidgetVisualization with hardcoded empty columns and data instead of the query results, so every table widget shows an empty table.
mediumThe breadcrumb-summary endpoint forwards the client's ?field= params into process_raw_response, which only needs error_ids: an unknown field raises KeyError (HTTP 500), and a field list without error_ids silently drops all error context from the summary.

Gold bugs missed (10)

mediumThe validation-failure warning logs the entire raw, attacker-controlled browser report instead of a redacted subset.
mediumThe custom cell renderers fall back to default rendering on any falsy return (0, '', null), not only undefined, so a renderer cannot render zero or an empty cell.
mediumThe attribute-keys query key no longer includes the organization slug, so two organizations with the same filters share a cache entry and switching orgs can show the previous org's attribute names.
mediumdelete_replays_script_async in replays/tasks.py still does range(0, max_segment_id) without a None check, so replays with no ingested segments raise TypeError, the case the PR fixed only in _make_recording_filenames.
mediumEvery paginated breadcrumb-summary request queries the replay and fetches all of its error events from nodestore with no cap, adding latency and memory proportional to the replay's error count on each page.
mediumHIDDEN_ATTRIBUTES is applied only when a search query is present; the no-search early return shows all attributes, so the hidden attributes still appear in the default span attributes view.
mediumThe bulk delete test sets max_segment_id to None to cover the new guard in _make_recording_filenames, but it mocks delete_matched_rows, so the guard is never executed and removing it would not fail the test.
mediumError event timestamps (seconds) are compared with replay recording event timestamps (milliseconds), so errors are not interleaved chronologically with breadcrumbs.
mediumanalyze_recording_segments gets every error in the replay on every paginated page, and gen_request_data emits all of them each time (earlier ones before the first event, the rest at the end), so every page repeats the replay's errors and attaches them to breadcrumbs from other time ranges.
mediumThe rewritten browser-reporting collector tests no longer post with content_type='application/reports+json', so the endpoint's BrowserReportsJSONParser and the reporting media type it exists for are untested; a broken parser would go unnoticed.