Repository navigation
Conversation
There was a problem hiding this comment.
Hi @iszmais
Thank you for wiring Forum into the new push provider mechanism.
Please answer the following questions:
- How should
PushQueueResult::UNKNOWNbe treated?NotificationsPushProvider::push()only returns true forPushQueueResult::SUCCEEDED. Unknown is treated as failure, so mail is sent as well. That can duplicate a notification that the endpoint already accepted.
Please consider the following suggestions. You do not need to follow those, but please indicate shortly why you prefer to do otherwise:
- Cache user objects / languages or load users in bulk.
ilObjectFactory::getInstanceByObjId()plusilLanguageFactory::_getLanguageOfUser()per recipient, then a synchronous Web Push request, will sit on the poster’s HTTP request. On forums with many subscribers this can make posting and instant notification slow enough that installations will leave the feature off. - Log push failures the same way you log success. Failures currently disappear into the mail fallback.
- The new language key
forums_forum_push_notification_descfollows the oldforums_*pattern. Current language rules prefer module prefixfrm_and_infofor setting bylines. Of course, existing Forum keys are inconsistent, so this is optional. - If
forum_notificationis disabled,filterMailRecipients()returns[]. That is redundant with the mail sender, but it is also easy to misread as "suppress all mail". Please prefer returning the original$recipientsand skipping push.
Please implement the following changes:
- Rename
$pushProviderto$push_providerinilForumAppEventListener. - Fix the action title on
ilNotificationLink.ilNotificationLinkstoresilNotificationParameter::getName()as title, andilNotificationPushHandler::buildContent()puts that string into the payloadactions[].title. You passforums_notification_show_postwith no parameters. The English translation is "Show post: %s" (the %s is the URL in mail). - If somehow possible, please do not construct
NotificationsPushProvider(ilNotificationPushHandler) unless push can actually run.getPushProvider()always doesnew NotificationsPushProvider($this), and the handler constructor doesfile_get_contents($settings->get('private_key_path')).ilSetting::get()declares?string, sofile_get_contents(null)results in a type error if no private key path can be found. That runs for every immediate Forum notification with recipients, even whenenable_pushis off or keys were never configured. The handler returns early innotify()when disabled, but the constructor already ran. A failed constructor would abortsendNotification()before mail is sent. Please guard onenable_push(and a usable key path), or make the handler construction null-safe, before this is merged.
Best regards,
Michael
|
@mjansenDatabay Thank you for your feedback. I updated the code. Most i implemented without any further addition from my side. Here are the exceptions:
I would prefer to send a duplicate notification (especially since it is over 2 channels) than missing out on one.
I cached the languages, but I don't see any angle to cache the users, especially since every user should only be called once per request by concept. Greetings, |
8acf7a1 to
34f68dc
Compare
|
@mjansenDatabay I added a line to the privacy.md of the Forum. Please another (final?) look! |
https://docu.ilias.de/go/wiki/wpage_9000_1357