Skip to content

feat(): Add periodic resolution task for sourcemap configuration detectors#109849

Open
wedamija wants to merge 1 commit intodanf/sourcemap-config-issues/pr4-detectionfrom
danf/sourcemap-config-issues/pr5-resolution
Open

feat(): Add periodic resolution task for sourcemap configuration detectors#109849
wedamija wants to merge 1 commit intodanf/sourcemap-config-issues/pr4-detectionfrom
danf/sourcemap-config-issues/pr5-resolution

Conversation

@wedamija
Copy link
Member

@wedamija wedamija commented Mar 3, 2026

Resolves stale sourcemap detectors when no new failures arrive for 30 minutes.

…ctors

Resolves stale sourcemap detectors when no new failures arrive for 30 minutes.
@wedamija wedamija requested review from a team March 3, 2026 23:49
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 3, 2026
Comment on lines +71 to +74
handler = state.detector.detector_handler
fingerprint = [
*handler.build_issue_fingerprint(),
handler.state_manager.build_key(None),
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: The handler variable can be None if state.detector.detector_handler returns None, but it's used without a null check, which will cause an AttributeError.
Severity: HIGH

Suggested Fix

Add a check to ensure handler is not None before attempting to access its methods. For example: handler = state.detector.detector_handler; if not handler: return.

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/processing_errors/tasks.py#L71-L74

Potential issue: The `detector_handler` property can return `None` under certain
conditions, such as registry corruption or version mismatches during deployment. The
code in `_resolve_detector` retrieves this handler but then attempts to call methods on
it (`build_issue_fingerprint`, `build_key`) without first checking if the handler is
`None`. This will lead to an `AttributeError`, crashing the periodic task responsible
for sourcemap detector resolution. Other parts of the codebase correctly handle this
`None` case by performing a check before using the handler.

Did we get this right? 👍 / 👎 to inform future reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant