[web] Handle notifications in service worker
Summary:
This diff modifies the service worker to actually handle the push event and display a notification, additionaly it modifies the other events:
- 'install' -> adds a skipWaiting so it will immediately take over the previous service worker
- 'activate' -> clients.claim() so it will claim tabs that aren't controlled by a service worker (while this tab wouldn't have a event listener and wouldn't be able to navigate to a chat when user click a notification, we will still be able to focus on it)
event.waitUntil is needed because otherwise the browser could put the service worker to sleep before the promises are resolved.
Test Plan: Rest if the notification shows up after getting a push event
Reviewers: tomek, atul, kamil
Reviewed By: tomek
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D6832