Repository navigation
Conversation
… hardcoded in frontend
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Notification updates can overwrite concurrent changes or partially persist rejected PATCHes, while missing client methods and skipped cleanup cause CI failures.
4 open issues
Keep notification registered for teardown cleanup · New Use HTTP GETs or add missing client methods for notification endpoint tests · New Use single-column updates to prevent overlapping PATCH requests from overwritin… · New Validate PATCH changes before persisting to avoid partial updates on errors · New
What changed in this PR
Adds backend discovery of notification actions and delivery channels for #2645, allowing the frontend to replace hardcoded notification options with server-provided metadata.
Changes:
- Registers two GET helpers exposing available actions, required permissions, and channels.
- Adds notification ownership checks, validated updates, and support for creating inactive settings.
- Updates OpenAPI documentation and adds API and schema tests.
| File | Description |
|---|---|
src/inc/utils/NotificationUtils.php |
Adds ownership checks and validated notification updates. |
src/inc/apiv2/model/NotificationSettingAPI.php |
Restricts owner access and connects update handlers. |
src/inc/apiv2/helper/GetNotificationChannelsHelperAPI.php |
Exposes registered delivery channels. |
src/inc/apiv2/helper/GetNotificationActionsHelperAPI.php |
Exposes actions and permission metadata. |
src/inc/apiv2/common/ApiRegistry.php |
Registers both notification helpers. |
openapi.json |
Documents helpers and revised notification settings. |
ci/phpunit/inc/apiv2/openapi/SpecBuilderHelperApiTest.php |
Tests helper response schemas. |
ci/apiv2/test_notification.py |
Tests notification updates, activation, and access control. |
ci/apiv2/test_notification_helper.py |
Tests action and channel discovery. |
Review effort: Balanced
|
|
||
| class NotificationActionsHelperTest(BaseTest): | ||
| def test_returns_actions(self): | ||
| actions = Helper().get_notification_actions() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Backend part for #2645
Needs changes from hashtopolis/python-hashtopolis#16 merged to pass tests