-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the notification's action to redirect to the settings page #78
Conversation
Codecov Report
@@ Coverage Diff @@
## master #78 +/- ##
============================================
- Coverage 71.8% 68.13% -3.68%
- Complexity 190 195 +5
============================================
Files 25 26 +1
Lines 876 932 +56
============================================
+ Hits 629 635 +6
- Misses 247 297 +50
Continue to review full report at Codecov.
|
Why in here? Shouldn't that all be handled in the notifications app? This feels wrong. The password_policy app should not care about the processing of the notifications. |
|
||
/** | ||
* @NoAdminRequired | ||
* @NoCSRFRequired |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no csrf on POST? This is critical!
@DeepDiver1975 this is based on the latest design in owncloud/notifications#212 basically we need the app to perform the action before the client starts its redirect, to be able to mark the notifications as processed maybe there's another way where the notifications app itself could provide a generic action (action class?) to invalidate a notification by id. @jvillafanez |
5d4b2bc
to
6849c79
Compare
password_policy is the app generating the notification, and since the action targets the password_policy app, this is the one that knows when the action has been correctly executed. In case there is a temporary error, the app might decide not to remove the notification and give the user another chance. In addition, the app can remove the notification if a proper action has been taken outside of the notification system. For example, if the user has changed the password the "password about to expire" notification should be removed regardless of the user clicking in the notification or not. Removing the notification from the notifications app might be difficult because the removal has to go through the notification manager, and the notification manager requires a notification (https://github.com/owncloud/core/blob/32b951f72f28018935eadb43567354ea70f58081/lib/public/Notification/IApp.php#L44) Note that the action is directed against the password_policy app, not against the notifications app. |
This is the flow I have in mind - and this is how I understood the specification:
|
I don't think it's possible with the current model. If the notifications app is the one invalidating, then all the actions should go through the notifications app in order to let the app invalidate the notification. So all the actions should have their links modified.
The question is where such url is in the notification. We can't put it as link because clients are expected to make an ajax request there, not to redirect.
A couple of questions here:
|
Fixes #73 (requires owncloud/notifications#212 support)
There is still minor things to do (mainly unittests), but code should work.