perfectyorg / perfecty-push-wp

WordPress plugin for self-hosted Web Push Notifications ⚡️
https://perfecty.org
GNU General Public License v2.0
85 stars 21 forks source link

413 Error - Entity Too Large for Firefox #132

Open jimorc opened 2 years ago

jimorc commented 2 years ago

I have installed Perfecty on my Wordpress website. In testing, I have signed up for notifications on two systems: Windows 10 PC with Edge browser, and Android 11 tablet with Firefox browser. I get notifications on the PC, but no notifications on the tablet.

Here are the relevant Perfecty log entries:

2022-01-12 12:30:02 | DEBUG | {"title":"Test Notification2","body":"Test","icon":"","image":"","require_interaction":false,"extra":{"url_to_open":"https:\/\/jimorchesonphotography.com"}}

2022-01-12 12:30:03 | ERROR | Failed to send one notification, error: Client error: POST https://updates.push.services.mozilla.com/wpush/v1/gAAAAABh3GFJ3S6lzZK8C6CLmcmkL8ZLlE5dP686m2Y1NcGedFVAuufajLst71DxTl1E0YixngkgcS1i9inSqS4D5d1ncZKTCvP3q0zAorHkJkaRmhcSltx89C1G6YFadz90j7SEIcZb resulted in a 413 Request Entity Too Large response: {"code": 413, "errno": 104, "error": "Payload Too Large", "more_info": "http://autopush.readthedocs.io/en/latest/http.ht (truncated...)

I have wp-cron.php turned off in wp-config.php. Instead, I run a cronjob every 30 minutes to execute wp-cron.php.

rwngallego commented 2 years ago

Hi, this is an active issue reported for Firefox on Android in our underlying library: https://github.com/web-push-libs/web-push-php/issues/62

From the issue:

Apparently Firefox for Mobile has restrictions of payload length. I filled an issue on mozilla-services/autopush#748 since it's not a standard behavior. In the meantime, you can disable automatic padding.`

It looks like we need to tune the automatic padding from the push library which is something we don't allow to the users at the plugin level.

jimorc commented 2 years ago

So at this point, there is nothing I can do? I guess I can live with losing the 0.5% of all browser users (the percentage of people who use Firefox Mobile).