Skip to content

Conversation

@ceorourke
Copy link
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

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

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.
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.

3 participants