Skip to content

chore(ACI): Remove temporary fallthrough type logic#103996

Merged
ceorourke merged 2 commits intomasterfrom
ceorourke/cleanup-fallthroughtype
Dec 1, 2025
Merged

chore(ACI): Remove temporary fallthrough type logic#103996
ceorourke merged 2 commits intomasterfrom
ceorourke/cleanup-fallthroughtype

Conversation

@ceorourke
Copy link
Copy Markdown
Member

Follow up to #103764 - once the migration is complete we can remove the temporary logic to support the incorrect case.

@ceorourke ceorourke requested review from a team as code owners November 25, 2025 19:20
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 25, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #103996      +/-   ##
===========================================
+ Coverage   74.95%    80.62%   +5.67%     
===========================================
  Files        9311      9313       +2     
  Lines      397391    397415      +24     
  Branches    25358     25358              
===========================================
+ Hits       297860    320425   +22565     
+ Misses      99074     76533   -22541     
  Partials      457       457              

@ceorourke ceorourke requested a review from a team as a code owner November 25, 2025 19:32
action_data["fallthrough_type"] = action.data["fallthroughType"]

blob = EmailDataBlob(**action_data)
blob = EmailDataBlob(**action.data)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: Removing fallthroughType backward compatibility before post-deployment migration causes TypeError.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The code removes backward compatibility logic for the fallthroughType field before its corresponding post-deployment migration has run. This causes a TypeError crash when EmailDataBlob(**action.data) is called with existing Action records that still contain fallthroughType (camelCase) in their action.data, as EmailDataBlob only accepts fallthrough_type (snake_case). This affects email notifications to issue owners immediately after deployment and before the migration 0104_action_data_fallthrough_type.py completes.

💡 Suggested Fix

Reinstate the backward compatibility logic to convert fallthroughType to fallthrough_type before passing action.data to EmailDataBlob, or ensure the migration runs before the code deployment.

🤖 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/notifications/notification_action/issue_alert_registry/handlers/email_issue_alert_handler.py#L54

Potential issue: The code removes backward compatibility logic for the `fallthroughType`
field before its corresponding post-deployment migration has run. This causes a
`TypeError` crash when `EmailDataBlob(**action.data)` is called with existing `Action`
records that still contain `fallthroughType` (camelCase) in their `action.data`, as
`EmailDataBlob` only accepts `fallthrough_type` (snake_case). This affects email
notifications to issue owners immediately after deployment and before the migration
`0104_action_data_fallthrough_type.py` completes.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 3588791

@ceorourke ceorourke merged commit 855acb2 into master Dec 1, 2025
66 checks passed
@ceorourke ceorourke deleted the ceorourke/cleanup-fallthroughtype branch December 1, 2025 22:15
jerryzhou196 pushed a commit that referenced this pull request Dec 1, 2025
Follow up to #103764 - once the
migration is complete we can remove the temporary logic to support the
incorrect case.
ceorourke added a commit that referenced this pull request Dec 9, 2025
Since [migrating the action data fallthrough
type](#103764) and [removing the
logic to support both snake case and camel
case](#103996) customers who
have actions with a fallthrough type of "no one" have been receiving a
surplus of notifications because the default value is
`FallthroughChoiceType.ACTIVE_MEMBERS` and we were not properly fetching
the `fallthrough_type`.

Fixes https://getsentry.atlassian.net/browse/ACI-564
Fixes #104478

Note that this PR fixes only `fallthrough_type` and the other options
for `target_type` and `target_identifier` are also incorrectly
attempting to fetch a camel case value when it's actually stored in
snake case in the database. This will need to be fixed in a follow up
PR.
@github-actions github-actions bot locked and limited conversation to collaborators Dec 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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