So, I need to improve the format of payloads sent by the Web Push API (previously it was used only internally by the webapp so there is like 95% coupling between the format and the JS code that handles it)

The most annoying, frustrating thing about this is trying to do string localization within a service worker (since I do not want to send such strings pre-formatted in the payload anymore)

@Gargron WebPush requires at least 4k payload to push services, but FCM for native app has more smaller 3k limitation and its payload have to contain decription key and salt.
please make some limitation about payload size!

@tateisu you mean max. 4k for Web push, right? The 3 strings will never exceed that, unlike the old chunky format

@Gargron About payload size limit, WebPush Protocol requires at least 4k. FCM Push service for native app guaranteed 3k.

@Gargron I checked actually payload size that send from mastodon.
currently 15923 bytes request body was detected.

@tateisu I'm just confused because you are saying the payload should be minimum 4K, while it seems to me that it should not be bigger than 4K

of cource it should not be bigger than 4K (for browser ).

Since the area where the client displays the notification is small, I think that the end of the text in the notification data should be omitted.

it should be shortened by byte unit, aiming at the boundary of the code point because the number of bytes consumed varies greatly depending on the type of character.

Sign in to participate in the conversation

Follow friends and discover new ones. Publish anything you want: links, pictures, text, video. This server is run by the main developers of the Mastodon project. Everyone is welcome as long as you follow our code of conduct!