fix: Add support for DISABLED status in SES verdict enums (#110)#111
Merged
fix: Add support for DISABLED status in SES verdict enums (#110)#111
Conversation
Closed
Closed
There was a problem hiding this comment.
Pull request overview
Adds support for AWS SES verdict status "DISABLED" so SES events with disabled checks decode correctly instead of failing JSON decoding.
Changes:
- Add
.disabled = "DISABLED"toSESEvent.Receipt.Verdict.Status. - Extend SES decoding tests with a new fixture containing
"status":"DISABLED". - Convert the SES JSON decoding test to a parameterized Swift Testing test.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
Sources/AWSLambdaEvents/SES.swift |
Adds the missing DISABLED enum case so SES verdicts can decode successfully. |
Tests/AWSLambdaEventsTests/SESTests.swift |
Adds a disabled-status SES fixture and runs the decoding test against both fixtures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
AWS SES can return "
DISABLED" as a valid status value for spam, virus, DKIM, and SPF verdicts when certain checks are disabled in the SES configuration. However, theSESEvent.Receipt.Verdict.Statusenum was missing this case, causing JSON decoding to fail with aDecodingErrorwhen parsing SES events containing{"status":"DISABLED"}.This issue was reported in #110, where users encountered parsing failures when processing legitimate SES events from AWS that included disabled verdict checks.
Modifications:
Added
.disabled = "DISABLED"case to theSESEvent.Receipt.Verdict.Statusenum inSES.swift
Converted the existing test to a parameterized test using Swift Testing's
@Test(arguments:)syntaxAdded a new test case (
eventBodyDisabled) that includes a SES event withspamVerdict.statusset to "DISABLED"Updated the test assertion to verify both
.passand.disabledstatus values are handled correctlyResult:
SES events with verdict statuses set to "
DISABLED" will now decode successfully without throwing errors. The library correctly handles all valid AWS SES verdict status values:PASS,FAIL,GRAY,PROCESSING_FAILED, andDISABLED. The parameterized test ensures both standard and disabled verdict scenarios are validated automatically.