Exclude comment deletion event from subscription events#198
Conversation
- Currently divided into Confluence <9 and v9+, but can be further divided to 10+ if the need ever arises
- Also fixing typo in README
There was a problem hiding this comment.
Pull Request Overview
This PR refactors webhook event handling to dynamically serve supported events based on Confluence server version (pre-v9.0 vs. v9.0+). The comment deletion event is now excluded for v9.0+ servers, with event filtering handled server-side rather than relying solely on webapp constants.
Key changes:
- Added a new
/configAPI endpoint that returns supported events based on server version - Implemented server-side validation to reject subscriptions with unsupported events
- Updated the subscription modal to fetch and display only supported events dynamically
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
webapp/src/components/subscription_modal/subscription_modal.jsx |
Loads plugin config on mount to fetch supported events and filters subscription events based on server configuration |
webapp/src/components/subscription_modal/subscription_modal.test.jsx |
Added test coverage for plugin config loading and mock implementation |
webapp/src/components/subscription_modal/index.js |
Connected getPluginConfig action to the subscription modal component |
webapp/src/client/client.js |
Added client method to fetch plugin configuration from the new /config endpoint |
webapp/src/actions/subscription_modal.js |
Implemented getPluginConfig action to retrieve plugin configuration |
webapp/src/actions/index.js |
Exported the new getPluginConfig action |
server/serializer/channel_subscription.go |
Added version-specific event lists, validation logic, and helper functions for event management |
server/save_subscription.go |
Added event validation against server version before saving subscriptions |
server/edit_subscription.go |
Added event validation against server version before editing subscriptions |
server/plugin_config.go |
Created new endpoint handler to serve supported events based on server version |
server/controller.go |
Registered the new /config endpoint in the controller |
README.md |
Fixed typo in documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wiggin77
left a comment
There was a problem hiding this comment.
Thanks @avasconcelos114 I have a question re auth but overall it looks good.
- Changed error return to fit coding standards
|
@wiggin77 Thanks for the review! I've switched the |
|
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
|
Synced with master branch to make sure it can be ready for a merge, let me know if anything else is needed! 🙌 |
nevyangelova
left a comment
There was a problem hiding this comment.
thanks @avasconcelos114 LGTM!
webapp/src/components/subscription_modal/subscription_modal.test.jsx
Outdated
Show resolved
Hide resolved
wiggin77
left a comment
There was a problem hiding this comment.
Great progress @avasconcelos114 I have a couple of questions that I think may be bugs.
|
Thanks for the review @wiggin77! Let me know what you think of the latest batch of changes 🙌 |
|
@avasconcelos114 "Comment Remove" still appears for me and is auto-selected by default on the subscription modal:
|
|
Plugin Spinwick PR #198 🎉 Test server created! Access here: https://confluence-pr-198-5yt6u.test.mattermost.cloud
The test server was created successfully, but there was an issue installing or enabling the plugin automatically:
You can manually install the plugin:
Future commits will still attempt to automatically update the plugin. Installation ID: Credentials: Posted securely in this Mattermost channel - Look for PR #198 |
|
@ogi-m Ahh great catch, there was an issue where the list of supported events stored in the client would reset when the modal is closed. I changed things so that the list of events supported that the server returns is preserved as it should |
|
Plugin test server update attempted, but encountered an issue: The test server is still available. You can manually download and install the updated plugin using the artifact link below. Updated with git commit
|
|
Plugin test server update attempted, but encountered an issue: The test server is still available. You can manually download and install the updated plugin using the artifact link below. Updated with git commit
|
ogi-m
left a comment
There was a problem hiding this comment.
Thanks @avasconcelos114, all good now!
|
Test server destroyed |


Summary
This PR reworks the displaying of webhook events so that the events shown are divided by <v9.0 and v9.0+, and are filtered by and responded by the server, instead of relying on constants in the webapp (though they still exist as a fallback value in case the API request fails)
In this PR, the comment deletion webhook event will now only appear if the Confluence plugin is configured to be used with a server of version below 9
It also adds validation on the save and edit subscription flows so that only supported events are accepted
Ticket Link
Fixes #195
QA Notes
Preparation
Test Steps
/confluence install serverand follow the wizard instructions to configure the plugin/confluence connectto connect accounts/confluence subscribeto open the modal to create a subscription to a channelComment removeevent does not appear as a selectable webhook event