app first load: the script try to fetch on 'swfs/init' to get the clientId but without waiting to be sure that the SW is fully activated (ie. serviceWorker.state = 'activated').
hard refresh: when calling for a hard refresh the browser behavior is to remove the page from the SW control, so navigator.serviceWorker.controller is null. The page has to call the SW and ask him to claim the page.
Two cases here:
serviceWorker.state = 'activated'
).navigator.serviceWorker.controller
isnull
. The page has to call the SW and ask him to claim the page.Both issue are fixed by this issue.