Skip to content

Comments

fix icon cache behavior breaking sw updates#117

Merged
a-type merged 2 commits intomainfrom
icon-cache-behavior
Apr 7, 2025
Merged

fix icon cache behavior breaking sw updates#117
a-type merged 2 commits intomainfrom
icon-cache-behavior

Conversation

@a-type
Copy link
Contributor

@a-type a-type commented Apr 7, 2025

Whenever we updated the app build, icon files got new hashes.

Since there are tons of icons and we only use ~10 of them, I had removed icons from the service worker precache (where all other app assets are).

This meant when the app was updated, the icon file paths in the old cached app version were attempted to resolve against remote files which no longer existed, due to the updated hash in the new build. So icons failed to import at all, breaking the app.

This removes the hash from icon filenames, so they should be resolveable in remote even if they weren't cached.

It also adds an on-demand caching of icon files as they are fetched, so that any icon used in the app should make it into the cache after first use.

Finally, adding a fallback for Icon to avoid a missing icon breaking the whole app.

@a-type a-type merged commit 7602853 into main Apr 7, 2025
@a-type a-type deleted the icon-cache-behavior branch April 7, 2025 17:47
a-type added a commit that referenced this pull request Apr 10, 2025
* fix icon cache behavior breaking sw updates

* icon fallback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant