[READ-ONLY] Mirror of https://github.com/improsocial/impro An extensible Bluesky client for web impro.social

Deliver pushes normally when the focused window fails to answer

The service worker skipped the system notification for any push that arrived while a window was focused, on the assumption that the page would refresh its unread counts from the postMessage. On Android the OS routinely suspends the WebAPK's renderer while its window still reports focused=true, so the message was never delivered and the push disappeared with no trace anywhere. The worker now transfers a MessagePort with the push-received message and waits up to a second for the page to acknowledge it. An answering page keeps the current behavior (no system notification, counts refresh). No answer means the window only looked focused, so the push is delivered as a normal system notification.


Author
Date Commit Parent 890e2d68
+116 -5
3 changed files
+116 -5
3 changed files