After visiting my forum which has this extension installed I noticed something that I did not notice before. After logging in I had to manually refresh the page to see that I did in fact log in. Then after logging out, I still appeared logged in. I again had to refresh the page to see that I was logged out. This was happening due to all of the extra caching this extension was doing. I thought the extra caching only affected the actual app version, but I was wrong. The caching also affected the regular browser version of the site. In an effort to fix this quickly without having to spend days, weeks, or months troubleshooting, I switched to a different Service Worker.
The new Service Worker does not do any caching. I take that back, it caches a new offline.html page. But, other than caching the new offline page, no caching is done by this extension now. This guarantees that there will be no more log in / log out hang ups or other similar issues.
- Updated sw.js (Service Worker) so that no caching (besides any caching Flarum already does) takes place. Except for a quick cache of the new offline page.
- offline.html added. Since the PWA will not work offline, this page is used to alert users that they must have lost internet connection. It states, "This app requires a network connection; it cannot be used offline. Please check your connection."
"orientation": "any" to the manifest. (Thanks, @mskian.)
Install / Update
If you've never installed this before go up to the first post in this thread and follow the instructions. If you are updating, run the
composer update zerosonesfun/pwa command. Be sure to deactivate and reactivate the extension in your admin panel; this refreshes important files in your public assets folder. Tweak your manifest file to your liking. Delete the existing manifest and sw.js file at your public root, and then copy the new manifest and sw.js file to your public root. Emptying any cache you can think of usually doesn't hurt either.