Skip to content

Commit 9283353

Browse files
ted kaemmingmattrobenolt
authored andcommitted
Merge pull request #2587 from drcapulet/alexc-fix-digest-types
Don't use unreliable identity check in digest pipeline. In some unknown cases, it's possible that the result of `record.value.event.group.get_status()` is a long rather than an integer. This results in the check `0L is 0` which is `False` (and not the correct answer to the intended check.) This will likely fix GH-2549.
1 parent 2682b0a commit 9283353

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/sentry/digests/notifications.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def build_digest(project, records, state=None):
200200
state = attach_state(**state)
201201

202202
def check_group_state(record):
203-
return record.value.event.group.get_status() is GroupStatus.UNRESOLVED
203+
return record.value.event.group.get_status() == GroupStatus.UNRESOLVED
204204

205205
pipeline = Pipeline(). \
206206
map(functools.partial(rewrite_record, **state)). \

tests/sentry/models/test_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ def test_status_with_expired_snooze(self):
9797
group=group,
9898
until=timezone.now() - timedelta(minutes=1),
9999
)
100-
assert group.get_status() is GroupStatus.UNRESOLVED
100+
assert group.get_status() == GroupStatus.UNRESOLVED

0 commit comments

Comments
 (0)