The notification that gave up after a minute

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

It's a timing thing. Fixed it but it took a second (no pun intended) to remember browser defaults are conservative.

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.

Your reply is in the thread. It’ll appear right here in about a minute.

Replies come from PopsicleBoat members, which is why there’s no spam. Posting takes you there to sign in (or create an account, it takes a short minute) and confirm your reply, then lands you right back here.

512KB Club Orange Team member