Skip to content

Add rejected_at to the thread message delivery - #270

Open
piobeny wants to merge 1 commit into
mainfrom
thread-delivery-rejected-at
Open

piobeny wants to merge 1 commit into
mainfrom
thread-delivery-rejected-at

Conversation

@piobeny

@piobeny piobeny commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

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

  • ThreadMessageDelivery: add RejectedAt (DateTimeOffset?, rejected_at), next to BouncedAt
  • Tests: RejectedAt is null on a delivered copy and parses the timestamp on a rejected one (new message in the thread fixture)

How to test

  • dotnet test tests/Mailtrap.IntegrationTests --filter "FullyQualifiedName~InboundThreads" passes
  • Get a thread with a reply to a suppressed address: that message's Delivery.RejectedAt holds a timestamp

Summary by CodeRabbit

  • New Features
    • Added a rejection timestamp to message delivery details, indicating when a message was rejected before sending.
  • Tests
    • Added coverage for rejected messages and verified that existing delivery and bounce timestamps remain unset where applicable.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The thread delivery model adds a nullable rejection timestamp. The thread details integration test and response fixture cover a not-delivered message with a rejection timestamp.

Changes: Rejected delivery timestamp

Layer / File(s) Summary
Add rejection timestamp
src/Mailtrap.Abstractions/Inbound/Models/ThreadMessageDelivery.cs
ThreadMessageDelivery adds the nullable RejectedAt property, mapped to rejected_at.
Cover rejected message in thread details
tests/Mailtrap.IntegrationTests/Inbound/InboundThreadsIntegrationTests.cs, tests/Mailtrap.IntegrationTests/Inbound/Threads/GetDetails_Success.json
The fixture adds a not-delivered message with a rejection timestamp. The test expects four messages and checks the rejection, delivered, and bounced timestamps.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Feature

Suggested reviewers: mklocek

Merge Risk: Minimal · up to 4baf0

This adds an optional RejectedAt timestamp to thread message delivery data, populated for messages rejected before sending (for example, a suppressed recipient). Existing consumers are unaffected because it is a nullable, additive field. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a new rejected_at field added to the thread message delivery model. It matches the ThreadMessageDelivery RejectedAt property and the related test fixture updates, so i…
Description check Passed The description follows the template's Motivation, Changes, and How to test sections. The motivation explains the API change and links the spec change. Changes lists the property and the test updates.…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a new rejected_at field added to the thread message delivery model. It matches the ThreadMessageDelivery RejectedAt property and the related test fixture updates, so it is accurate and specific.

Full details: Description check

Explanation

The description follows the template's Motivation, Changes, and How to test sections. The motivation explains the API change and links the spec change. Changes lists the property and the test updates. How to test gives a test command and a manual scenario, but both items are unchecked and no test result is reported. The Images and GIFs section is omitted, which is acceptable for a non-visual API change.

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

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f5368072-df1d-4e19-8d87-18b3955f08a5
Commits

Reviewing files that changed from the base of the PR and between 9398dcf and 4baf0a5.

Files selected for processing: 3

  • src/Mailtrap.Abstractions/Inbound/Models/ThreadMessageDelivery.cs
  • tests/Mailtrap.IntegrationTests/Inbound/InboundThreadsIntegrationTests.cs
  • tests/Mailtrap.IntegrationTests/Inbound/Threads/GetDetails_Success.json

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@piobeny
piobeny marked this pull request as ready for review November 18, 2026 09:42
@piobeny
piobeny requested a review from mklocek as a code owner November 18, 2026 09:42
@piobeny
piobeny requested review from VladimirTaytor and mklocek and removed request for mklocek November 18, 2026 09:42

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants