Skip to content

Add message call metadata#7

Open
Adri11334 wants to merge 1 commit into
beeper:beeperfrom
Adri11334:message-call-metadata
Open

Add message call metadata#7
Adri11334 wants to merge 1 commit into
beeper:beeperfrom
Adri11334:message-call-metadata

Conversation

@Adri11334

@Adri11334 Adri11334 commented Jun 15, 2026

Copy link
Copy Markdown

Summary

Adds Discord private call metadata to Message so consumers can read the call participant list and optional end timestamp from gateway message payloads.

Changes

  • add MessageCall for call.participants and call.ended_timestamp
  • expose Message.Call on message payloads
  • keep call metadata when partial message updates are merged into state
  • cover active calls, ended calls, and state merge behavior in tests

Testing

  • go test . -run 'TestMessage_Unmarshal(Call|ActiveCall)|TestState_MessageAddMergesCall' -count=1

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Adri11334, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 20 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1748e6c0-1910-4538-840a-15d3f23e7cbb

📥 Commits

Reviewing files that changed from the base of the PR and between 12a1d26 and 9ad2277.

📒 Files selected for processing (4)
  • message.go
  • message_call.go
  • message_test.go
  • state.go
📝 Walkthrough

Walkthrough

Adds a new MessageCall struct with Participants and EndedTimestamp fields to represent private call metadata. The Message struct gains an optional Call *MessageCall field. State.MessageAdd is updated to copy the Call field from incoming messages when non-nil, and three new tests cover unmarshalling and state merge behavior.

Changes

MessageCall Support

Layer / File(s) Summary
MessageCall type and Message field
message_call.go, message.go
MessageCall struct is introduced with Participants []string and EndedTimestamp *time.Time; the Message struct gains a Call *MessageCall field with json:"call,omitempty".
State merge and test coverage
state.go, message_test.go
State.MessageAdd conditionally copies Call from the incoming message when non-nil; tests verify JSON unmarshalling of a finished call, an active call with null ended_timestamp, and state merge that preserves author while updating call participants and EndedTimestamp.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: adding message call metadata support to the Message type.
Description check ✅ Passed The description is directly related to the changeset, detailing the new MessageCall struct, Message.Call field exposure, state merge behavior, and testing approach.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@Adri11334 Adri11334 marked this pull request as ready for review June 15, 2026 16:17
Copilot AI review requested due to automatic review settings June 15, 2026 16:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for Discord “call” metadata on messages and ensures State.MessageAdd merges call updates into cached messages.

Changes:

  • Add Message.Call field and new MessageCall type for call metadata.
  • Update State.MessageAdd to merge Call into existing cached messages.
  • Add tests covering JSON unmarshalling of call and state merge behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
state.go Merge the Call field when updating an existing cached message.
message.go Add Call *MessageCall to the Message struct JSON model.
message_call.go Introduce MessageCall type to represent call participants and end time.
message_test.go Add unit tests for call unmarshalling and state merge semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread state.go
Comment thread message_call.go
Comment on lines +8 to +11
Participants []string `json:"participants"`

// The time at which the call ended, if it has ended.
EndedTimestamp *time.Time `json:"ended_timestamp"`
@Adri11334 Adri11334 force-pushed the message-call-metadata branch from 12a1d26 to 9ad2277 Compare June 15, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants