Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Fix forwarding to newest version of JS bundle chunks #3753

Merged
merged 1 commit into from Aug 11, 2018

Conversation

mxstbr
Copy link
Contributor

@mxstbr mxstbr commented Aug 10, 2018

Status

  • WIP
  • Ready for review
  • Needs testing

Deploy after merge (delete what needn't be deployed)

  • hyperion (frontend)

ServiceWorker installs are failing because old ServiceWorkers are trying to cache old versions of the JavaScript chunks. Unfortunately, the bundle filenames change with each release so if the SW tries to cache UserSettings.asdf123.chunk.js and we've released a new verion, that file is called something entirely different like UserSettings.lkjli53.chunk.js instead!

This fixes the issue by forwarding old asset names to the new name, i.e. if a user requests UserSettings.asdf123.chunk.js but the current name is UserSettingsings.lkjli53.chunk.js we forward them to the new version.

This should potentially fix some ServiceWorker problems!

Shoutout to @matheuss for pointing me in the right direction with his bug report.

ServiceWorker installs are failing because old ServiceWorkers are trying
to cache old versions of the bundle. Unfortunately, the hash changes with
each release so if the SW tries to cache `UserSettings.asdf123.chunk.js`
and we've released a new verion, that file is called something entirely
different like `UserSettings.lkjli53.chunk.js` instead!

This fixes the issue by forwarding old asset names to the new name, i.e.
if a user requests `UserSettings.asdf123.chunk.js` but the current name
is `UserSettingsings.lkjli53.chunk.js` we forward them to the new version.

This should potentially fix some ServiceWorker problems!
Copy link
Contributor

@brianlovin brianlovin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find - let's do a prod cut of this monday?

@brianlovin brianlovin merged commit aa78b79 into alpha Aug 11, 2018
@brianlovin brianlovin deleted the fix-hyperion-forwarding-to-new-versions branch August 11, 2018 02:25
@mxstbr
Copy link
Contributor Author

mxstbr commented Aug 11, 2018

I'm going to do one now!

@brianlovin
Copy link
Contributor

Sounds good, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants