-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore(ACI): Remove temporary fallthrough type logic #103996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
| action_data["fallthrough_type"] = action.data["fallthroughType"] | ||
|
|
||
| blob = EmailDataBlob(**action_data) | ||
| blob = EmailDataBlob(**action.data) |
There was a problem hiding this comment.
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
Follow up to #103764 - once the migration is complete we can remove the temporary logic to support the incorrect case.