Skip to content

Add rejected_at to the thread message delivery - #95

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

  • InboundThreadMessageDelivery: add rejectedAt (OffsetDateTime, 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

  • mvn -Dtest=InboundThreadsImplTest test passes
  • Get a thread with a reply to a suppressed address: that message's getDelivery().getRejectedAt() holds a timestamp

Summary by CodeRabbit

  • New Features
    • Inbound thread message delivery details now include a rejection timestamp when available. Messages that were not delivered can report this time, while delivered messages show no rejection timestamp.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The inbound delivery model adds a rejectedAt timestamp mapped to rejected_at. The thread response fixture and tests cover a delivered message with no rejection timestamp and a not-delivered message with a rejection timestamp.

Changes: Inbound delivery response

Layer / File(s) Summary
Rejection timestamp mapping and response coverage
src/main/java/io/mailtrap/model/response/inbound/InboundThreadMessageDelivery.java, src/test/resources/api/inbound/getInboundThreadResponse.json, src/test/java/io/mailtrap/api/inbound/InboundThreadsImplTest.java
The delivery model maps rejected_at to rejectedAt. The fixture includes a not-delivered message with a rejection timestamp. Tests verify the message count, its status and timestamps, and a null rejection timestamp for a delivered message.

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

Change: Feature

Suggested reviewers: mklocek

Merge Risk: Minimal · up to 709bb

This adds a rejection timestamp to thread message delivery responses. It is a small additive change with test coverage, and no actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Add rejected_at to the thread message delivery" matches the main change: the PR adds a rejectedAt (rejected_at) field to InboundThreadMessageDelivery, and the test fixture and assertions co…
Description check Passed The description follows the template's Motivation, Changes, and How to test sections. Motivation explains that the Get a thread API now returns rejected_at for outbound messages and links the spec cha…
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 "Add rejected_at to the thread message delivery" matches the main change: the PR adds a rejectedAt (rejected_at) field to InboundThreadMessageDelivery, and the test fixture and assertions cover it. It is specific and names the affected object, so a teammate scanning history would understand the primary change.

Full details: Description check

Explanation

The description follows the template's Motivation, Changes, and How to test sections. Motivation explains that the Get a thread API now returns rejected_at for outbound messages and links the spec change. Changes lists the field addition and the test updates. How to test gives a Maven command and a manual check. The Images and GIFs section is absent, but it is not critical for this backend-only change. The How to test items are unchecked, which is normal before running them.

  • 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: 2cfa29fc-f576-4459-8939-53173b106ca3
Commits

Reviewing files that changed from the base of the PR and between 88b6013 and 709bb89.

Files selected for processing: 3

  • src/main/java/io/mailtrap/model/response/inbound/InboundThreadMessageDelivery.java
  • src/test/java/io/mailtrap/api/inbound/InboundThreadsImplTest.java
  • src/test/resources/api/inbound/getInboundThreadResponse.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

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.

1 participant