Skip to content

Upgrade invalidates Views urls, making the PWA unusable without refreshing #49

@andrea3x

Description

@andrea3x

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

  1. Create and run a Docker container with an older version of SM (I tested with image id 5caf37387e21)
  2. Visit the website and perform some actions so that the service worker can install itself
  3. Close the tab
  4. 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]
  5. Visit the website again and wait a few seconds for the SW to update
  6. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions