The notification that gave up after a minute

Projects
Popsicleboat, Web-Push

I added browser push notifications recently.

Then I replied to one of my own posts from my phone, looked at my laptop, and saw nothing.

The reply was on the site, everything else worked, like the inbox badge, notification email, etc. Just the browser push notification did not.

I had given my browser permission to post notifications for my site, but didn’t realize by default that permission expires (I was using Brave, it might be different for other browsers).

Gave it permission again with “forever” as the setting this time and banners worked. All was good for about an hour, until I noticed pushes still vanished whenever the browser wasn’t running. As it turns out, the library holds a closed browser’s message for only 60 seconds by default.

The fix is one option:

send_notification(payload, message, ttl: 86_400)

I set the send notification ttl to a day. That should, depending on the user’s preference, maintain the message across closing the browser for instance.

I hope this feature is useful, if not it’s opt in anyway. As all notifications should be.

Replies come from Popsicle Boat members. Accounts are required, it’s why there’s no spam. You’ll sign in there (or create an account, it takes a short minute), confirm before it posts, and land right back here after.

512KB Club Orange Team member