OneSignal / OneSignal-WordPress-Plugin

OneSignal is a free push notification service for web and mobile apps. This plugin makes it easy to integrate your website with OneSignal Push Notifications. https://onesignal.com
Other
78 stars 42 forks source link

2.4.0 Release - remove recipient count #312

Closed rgomezp closed 1 year ago

rgomezp commented 1 year ago

1 sentence summary

Removes the recipient count used in the editor notices.

Overview

In an effort to ease server computational costs, we will no longer return the recipient count as part of the response body to POST notification.

Thus we must remove it from the plugin notices.

Other changes

Update tested up to value to 6.3


This change is Reviewable

rgomezp commented 1 year ago

Due to the sleep causing delays in the posting response, and also that the notification might not be done sending within 10 seconds what do you think about moving this REST API GET /notiications/(id) call to the has_metadata ?

What if in that has_metadata method if get_post_meta($post_id, 'recipients'); returns null we make the REST API request to get the recipients from there?

has_metadata is only called from the Gutenberg editor, so that wouldn't work for Classic.

It's true that the post would appear to take longer to successfully post, although this is not exactly true. The post publish will be successful, kick off the lifecycle event that fires the notification send and that is what would make the post appear longer to publish from the editor perspective.

The notification is sent immediately, however.

While this is not ideal, there aren't many good options. Some options I've already considered: