Skip to content

[messages] expose createdAt field in status - #272

Open
capcom6 wants to merge 3 commits into
masterfrom
messages/created-at-field
Open

capcom6 wants to merge 3 commits into
masterfrom
messages/created-at-field

Conversation

@capcom6

@capcom6 capcom6 commented Aug 30, 2026 •

Copy link
Copy Markdown
Member

RetriggerConfidence Score: 3/5

The PR is not yet safe to merge because enqueue responses can still expose an invalid creation time on supported MySQL deployments and scheduled status responses still omit their delivery time.

Findings

  1. P2 Scheduled time missing from status ▶
Fix with agent prompt
### Issue 1
internal/sms-gateway/handlers/converters/messages.go:undefined-64
The status schema now advertises `scheduleAt`, but this converter always sets it to nil. For scheduled messages, enqueue, status, and history responses omit the persisted delivery time, so API consumers cannot recover the schedule from the status response.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR exposes message creation timestamps in status responses and updates the client contract and generated OpenAPI documentation. It also adjusts enqueue ordering and normalizes empty mobile push tokens.

  • Adds createdAt to the message-state domain and API conversion.
  • Moves persistence ahead of enqueue-state conversion.
  • Updates the generated API/client models and device conversion.
  • Normalizes empty push tokens so event delivery can continue using SSE.
  • Refreshes environment documentation and dependency metadata.

Reviews (13) · Last reviewed commit: "[mobile] keep empty push token from disa..." · Reviewed by Greptile

Comment thread internal/sms-gateway/handlers/converters/messages.go
@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

🤖 Pull request artifacts

Platform File
🐳 Docker GitHub Container Registry
🍎 Darwin arm64 server_Darwin_arm64.tar.gz
🍎 Darwin x86_64 server_Darwin_x86_64.tar.gz
🐧 Linux arm64 server_Linux_arm64.tar.gz
🐧 Linux i386 server_Linux_i386.tar.gz
🐧 Linux x86_64 server_Linux_x86_64.tar.gz
🪟 Windows arm64 server_Windows_arm64.zip
🪟 Windows i386 server_Windows_i386.zip
🪟 Windows x86_64 server_Windows_x86_64.zip

@capcom6
capcom6 force-pushed the messages/created-at-field branch 2 times, most recently from 0d72867 to c58b63b Compare September 2, 2026 01:16
Comment thread internal/sms-gateway/modules/messages/service.go
@capcom6
capcom6 force-pushed the messages/created-at-field branch from c58b63b to bba39d4 Compare September 2, 2026 02:20
Comment thread internal/sms-gateway/modules/messages/service.go
@capcom6 capcom6 added the ready label Sep 3, 2026
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 7 days with no activity.

@github-actions github-actions Bot added the stale label Sep 10, 2026
@capcom6 capcom6 removed the stale label Sep 12, 2026
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 7 days with no activity.

@github-actions github-actions Bot added the stale label Sep 19, 2026
@capcom6 capcom6 removed the stale label Sep 21, 2026
@capcom6
capcom6 force-pushed the messages/created-at-field branch from bba39d4 to 3faa1e8 Compare September 25, 2026 01:35
@github-actions github-actions Bot removed the ready label Sep 25, 2026
@capcom6 capcom6 added the ready label Sep 28, 2026
@capcom6
capcom6 force-pushed the messages/created-at-field branch from dc08171 to 4f0ed28 Compare September 29, 2026 01:41
@github-actions github-actions Bot removed the ready label Sep 29, 2026
@capcom6
capcom6 force-pushed the messages/created-at-field branch from d609a2c to 1b2fddc Compare September 30, 2026 05:28
@capcom6 capcom6 added the ready label Oct 1, 2026
@capcom6
capcom6 force-pushed the messages/created-at-field branch from 1b2fddc to 4a39a58 Compare October 2, 2026 01:03
@github-actions github-actions Bot removed the ready label Oct 2, 2026
MmsMessage: state.MmsContent,
HashedMessage: state.HashedContent,

ScheduleAt: nil,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Scheduled time missing from status

The status schema now advertises scheduleAt, but this converter always sets it to nil. For scheduled messages, enqueue, status, and history responses omit the persisted delivery time, so API consumers cannot recover the schedule from the status response.

Knowledge Base Used:

Prompt To Fix With AI
This is a comment left during a code review.
Path: internal/sms-gateway/handlers/converters/messages.go
Line: 64

Comment:
**Scheduled time missing from status**

The status schema now advertises `scheduleAt`, but this converter always sets it to nil. For scheduled messages, enqueue, status, and history responses omit the persisted delivery time, so API consumers cannot recover the schedule from the status response.

**Knowledge Base Used:**
- [SMS message delivery lifecycle](https://app.greptile.com/smsgate-app/-/custom-context/knowledge-base/android-sms-gateway/server/-/docs/message-delivery-lifecycle.md)
- [API contracts and external integrations](https://app.greptile.com/smsgate-app/-/custom-context/knowledge-base/android-sms-gateway/server/-/docs/api-contracts-and-integrations.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment thread internal/sms-gateway/handlers/mobile.go Outdated
client-go 1.16.1 changed MobileUpdateRequest.PushToken to *string, and
passing it straight through persisted an empty token on PATCH /mobile/v1/device.
Event dispatch treats any non-nil token as a reason to push and skips the
device SSE connection, so such a device stopped receiving enqueue and
cancellation notifications.

Normalize an empty value back to nil to preserve the pre-upgrade behavior.

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