Skip to content

Commit

Permalink
Fix update worker issues due to lack of old path redirect
Browse files Browse the repository at this point in the history
Old UIs were still querying the old path (/update-worker.js) to refresh
their service worker, which no longer exists. The new path works just
fine, and is referenced correctly from the HTML, but wasn't accessed
until _after_ the UI had updated, leaving us in a bit of a bind.

This unties that knot with a proper redirect. We should probably leave
this in place for quite a while, since it's required for updates until
all UIs have reached this commit or later.
  • Loading branch information
pimterry committed Sep 4, 2023
1 parent 916d9af commit a2d97f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

header *.wasm Content-Type "application/wasm"

rewrite /update-worker.js /ui-update-worker.js

root * /site
try_files {path} /index.html
file_server
Expand Down
2 changes: 0 additions & 2 deletions src/services/update-management.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import dedent from 'dedent';

import registerUpdateWorker, {
ServiceWorkerNoSupportError
} from 'service-worker-loader!./ui-update-worker';
Expand Down

0 comments on commit a2d97f5

Please sign in to comment.