cybex-dev / twilio_voice

Flutter Twilio Voice Plugin
https://twilio-voice-web.web.app/
MIT License
39 stars 80 forks source link

Fix: Web notifications stop showing on page (soft) refreshing #147

Closed cybex-dev closed 1 year ago

cybex-dev commented 1 year ago

Upon a page refresh (soft) via direct or indirect, notifications will stop working due to the page controller being reassigned (i.e. null).

A solution provided https://github.com/mswjs/msw/issues/98#issuecomment-612118211 suggests unregistering all registrations, then attempting to re-register.

This may however have adverse effects on the existing flutter_service_worker.js.

In future, a better solution may be to incorporate the custom service worker code into the predefined and 'hardcoded' flutter_service_worker.js file (generated on flutter build web) via a Makefile script as suggested here via github actions and/or with an Makefile example here