Skip to content

Feat: make some events webhook compatible#12936

Open
janepie wants to merge 2 commits into
mainfrom
feat/webhook-events
Open

Feat: make some events webhook compatible#12936
janepie wants to merge 2 commits into
mainfrom
feat/webhook-events

Conversation

@janepie
Copy link
Copy Markdown
Member

@janepie janepie commented May 14, 2026

Makes these event types webhook compatible:

  • NewMessageReceivedEvent
  • MessageSentEvent
  • MessageFlaggedEvent
  • MessageDeletedEvent

@welcome
Copy link
Copy Markdown

welcome Bot commented May 14, 2026

Thanks for opening your first pull request in this repository! ✌️

Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
@janepie janepie force-pushed the feat/webhook-events branch from cfb6a98 to de266d2 Compare May 14, 2026 12:51
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds webhook serialization support to message events. MessageDeletedEvent, MessageFlaggedEvent, and MessageSentEvent each implement IWebhookCompatibleEvent with a getWebhookSerializable() method exposing relevant event properties. NewMessageReceivedEvent undergoes a broader structural change: its constructor now accepts both a URI string and a Message entity (previously only the URI), and its webhook serialization exports both fields. The NewMessagesNotifier listener is updated to dispatch the event with both parameters.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main objective of the changeset: making specific event classes webhook compatible by implementing IWebhookCompatibleEvent.
Description check ✅ Passed The description directly relates to the changeset by listing the four event classes being made webhook compatible, which matches the actual file modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
lib/Events/MessageSentEvent.php (1)

40-43: ⚡ Quick win

Stabilize the webhook contract with an explicit payload schema.

Serializing LocalMessage directly couples webhook output to internal entity shape and can expose more fields than intended. Prefer a curated flat payload (for example IDs + explicitly selected message fields).

lib/Events/NewMessageReceivedEvent.php (1)

27-31: ⚡ Quick win

Avoid emitting raw Message entities in webhook payloads.

Returning the entity directly makes the external webhook schema implicit and fragile. Prefer an explicit, versionable payload with selected fields only.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c4a4f676-a8aa-41b8-8c4c-d5989f2ddac6

📥 Commits

Reviewing files that changed from the base of the PR and between 114629c and cfb6a98.

📒 Files selected for processing (5)
  • lib/Events/MessageDeletedEvent.php
  • lib/Events/MessageFlaggedEvent.php
  • lib/Events/MessageSentEvent.php
  • lib/Events/NewMessageReceivedEvent.php
  • lib/Listener/NewMessagesNotifier.php

@janepie janepie requested a review from GretaD as a code owner May 14, 2026 13:05
Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
@janepie janepie force-pushed the feat/webhook-events branch from 8211490 to d9199cc Compare May 14, 2026 13:07
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