-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Hi all!
I recently noticed that upgrading my SM Docker container would often renders the web app unusable.
At first glance, all surfaces that would change view (like the navigation menus, among other items) stop working:
Broken.Swing.Music.mp4
Further investigation revealed that this is a problem caused by how the PWA works.
How to replicate
- Create and run a Docker container with an older version of SM (I tested with image id
5caf37387e21
) - Visit the website and perform some actions so that the service worker can install itself
- Close the tab
- Upgrade the Docker container with the latest version of SM (I tested with image id
833747696334
) [please note that changes to the web client source code are also required to reproduce this] - Visit the website again and wait a few seconds for the SW to update
- Click on the clickable surfaces and notice that they don't change the view
Logs in the console
when clicking on "Playlists":
GET https://example.com/assets/PlaylistList.09d7d16b.js 404 NS_ERROR_CORRUPTED_CONTENT
TypeError: error loading dynamically imported module: https://example.com/assets/PlaylistList.09d7d16b.js index.7685dc52.js:28:21396
Workarounds
The first is refreshing. Easy, right? Yes, but not in all environments.
For example, the Chrome-installed PWA makes refreshing very difficult. A less tech-savvy person would have to learn how to fully close and reopen the app.
I haven't tested it yet, but I think a second workaround is to disabling hashes on filenames in vite.config.ts
.
Although they appear to solve the problem, I believe they are not the definitive solution.
What can we do about this?
Thanks in advance to all who will participate in the conversation!