Skip to content

feat(sourcemap-issues): Add SourcemapDetectorHandler#109633

Merged
wedamija merged 2 commits intomasterfrom
danf/sourcemap-config-issues/pr2-detector-handler
Mar 5, 2026
Merged

feat(sourcemap-issues): Add SourcemapDetectorHandler#109633
wedamija merged 2 commits intomasterfrom
danf/sourcemap-config-issues/pr2-detector-handler

Conversation

@wedamija
Copy link
Member

Implements the detector handler for sourcemap configuration issues. Extends StatefulDetectorHandler but overrides evaluate_impl to skip dedupe/threshold logic and use atomic filter().update() on DetectorState as a lock to prevent duplicate occurrence creation across concurrent processes. Resolution is handled separately by a periodic task.

@wedamija wedamija requested review from a team February 28, 2026 01:01
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 28, 2026
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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.

Base automatically changed from danf/refactor-eventerror-strenum to master March 2, 2026 19:31
@wedamija wedamija requested review from a team as code owners March 2, 2026 19:31
@wedamija wedamija changed the title Add SourcemapDetectorHandler with atomic state transitions Add SourcemapDetectorHandler Mar 2, 2026
Implements the detector handler for sourcemap configuration issues. Extends StatefulDetectorHandler but overrides evaluate_impl to skip dedupe/threshold logic and use atomic filter().update() on DetectorState as a lock to prevent duplicate occurrence creation across concurrent processes. Resolution is handled separately by a periodic task.
@wedamija wedamija force-pushed the danf/sourcemap-config-issues/pr2-detector-handler branch from 3eb80c0 to 71f2170 Compare March 2, 2026 19:32
@wedamija wedamija changed the title Add SourcemapDetectorHandler feat(sourcemap-issues): Add SourcemapDetectorHandler Mar 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Backend Test Failures

Failures on f9cd263 in this run:

tests/sentry/processing_errors/test_grouptype.py::TestSourcemapDetectorHandler::test_failure_without_detector_state_creates_itlog
tests/sentry/processing_errors/test_grouptype.py:137: in test_failure_without_detector_state_creates_it
    result = self.handle_result(
tests/sentry/processing_errors/test_grouptype.py:77: in handle_result
    evaluation = handler.evaluate(data_packet)
src/sentry/workflow_engine/handlers/detector/base.py:148: in evaluate
    value = self.evaluate_impl(data_packet)
src/sentry/processing_errors/grouptype.py:163: in evaluate_impl
    rows_updated = self._try_state_transition(DetectorPriorityLevel.HIGH)
src/sentry/processing_errors/grouptype.py:191: in _try_state_transition
    with transaction.atomic():
src/sentry/testutils/pytest/stale_database_reads.py:120: in atomic
    return old_atomic(*args, **kwargs)
src/sentry/silo/patches/silo_aware_transaction_patch.py:40: in siloed_atomic
    validate_transaction_using_for_silo_mode(using)
src/sentry/silo/patches/silo_aware_transaction_patch.py:95: in validate_transaction_using_for_silo_mode
    raise TransactionMissingDBException("'using' must be specified when creating a transaction")
E   sentry.silo.patches.silo_aware_transaction_patch.TransactionMissingDBException: 'using' must be specified when creating a transaction

…omic()

Catching IntegrityError without transaction.atomic() leaves the DB
connection in a broken state when called inside a transaction (e.g.
Django tests). Wrapping the create() in its own savepoint ensures
the IntegrityError is cleanly rolled back.
@wedamija wedamija force-pushed the danf/sourcemap-config-issues/pr2-detector-handler branch from 7c2c2ed to 29a41b3 Compare March 4, 2026 22:01
@wedamija wedamija merged commit f943d37 into master Mar 5, 2026
76 checks passed
@wedamija wedamija deleted the danf/sourcemap-config-issues/pr2-detector-handler branch March 5, 2026 00:00
JonasBa pushed a commit that referenced this pull request Mar 5, 2026
Implements the detector handler for sourcemap configuration issues.
Extends StatefulDetectorHandler but overrides evaluate_impl to skip
dedupe/threshold logic and use atomic filter().update() on DetectorState
as a lock to prevent duplicate occurrence creation across concurrent
processes. Resolution is handled separately by a periodic task.

<!-- Describe your PR here. -->
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.

2 participants