You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add rejected_at to the thread message delivery - #96
The Get a thread API now returns rejected_at in the delivery object of sent (outbound) messages: the time a copy was rejected before sending, for example because the recipient is on the suppression list, and null otherwise. Spec change: mailtrap/mailtrap-openapi#75.
Changes
InboundThreadMessageDelivery: add rejected_at: Optional[str] = None, next to bounced_at
Tests: rejected_at is None on a delivered copy and maps the timestamp on a rejected one
Get a thread with a reply to a suppressed address: that message's delivery.rejected_at holds a timestamp
Summary by CodeRabbit
New Features
Inbound message delivery details can now include the timestamp when a message was rejected. The field is optional and remains empty when no rejection timestamp is available. This also distinguishes rejected messages from messages with delivery or bounce timestamps.
No actionable comments were generated in the recent review.
Walkthrough
The inbound thread delivery model adds an optional rejected_at timestamp. Tests cover missing and populated rejection timestamps in delivered and not-delivered message responses.
Changes: Inbound delivery timestamp
Layer / File(s)
Summary
Rejection timestamp field and test coverage mailtrap/models/inbound.py, tests/unit/api/inbound/test_inbound_threads.py
InboundThreadMessageDelivery adds optional rejected_at, defaulting to None. Tests check that delivered messages map to None and that not-delivered messages retain the supplied timestamp while bounced_at remains None.
This adds an optional rejection timestamp to inbound thread message delivery. Existing responses without the field still parse, and the change is covered by unit tests. The merge risk is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: an optional rejected_at field added to the thread message delivery model (InboundThreadMessageDelivery). It matches the raw summary, the PR description, and the object…
Description check
The description covers motivation (Get a thread API now returns rejected_at for outbound messages, with a spec reference), the changes (field addition and tests), and how to test (pytest command and a…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: an optional rejected_at field added to the thread message delivery model (InboundThreadMessageDelivery). It matches the raw summary, the PR description, and the objectives. It is specific and descriptive, not vague.
Full details: Description check
Explanation
The description covers motivation (Get a thread API now returns rejected_at for outbound messages, with a spec reference), the changes (field addition and tests), and how to test (pytest command and a manual API check). It follows the template's sections. The Images and GIFs section is omitted, but it is not critical for this backend-only change. The test checkboxes are unchecked, which is normal before merge.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 2e4a3fde-9f60-4cf9-ad93-f71f568b849d
Commits
Reviewing files that changed from the base of the PR and between 23afc93 and 56cbbc7.
Files selected for processing: 2
mailtrap/models/inbound.py
tests/unit/api/inbound/test_inbound_threads.py
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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
The Get a thread API now returns
rejected_atin thedeliveryobject of sent (outbound) messages: the time a copy was rejected before sending, for example because the recipient is on the suppression list, andnullotherwise. Spec change: mailtrap/mailtrap-openapi#75.Changes
InboundThreadMessageDelivery: addrejected_at: Optional[str] = None, next tobounced_atrejected_atisNoneon a delivered copy and maps the timestamp on a rejected oneHow to test
pytest tests/unit/api/inbound/test_inbound_threads.pypassesdelivery.rejected_atholds a timestampSummary by CodeRabbit