Eugen is a user on You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
Eugen @Gargron

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)

· Web · 0 · 2

@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.