gatsby icon indicating copy to clipboard operation
gatsby copied to clipboard

Fix: Gatsby-Plugin-Offline Double Reload Issue

Open emmron opened this issue 1 year ago • 1 comments

Issue: The Gatsby-Plugin-Offline requires two reloads to properly cache and serve the index page, causing a blank screen on the second reload.

Solution:

1.	Updated service worker logic to cache the index page and component-src files on the first load.
2.	Ensured service worker correctly responds to requests with cached resources.

Documentation:

•	Updated caching logic documentation in the plugin’s README.

Tests

•	Added unit tests to verify the correct caching of index and component-src files.
•	Performed manual tests to confirm the offline experience works without requiring double reloads.

Related Issues

•	Fixes #39041

emmron avatar Jul 13 '24 15:07 emmron

@jhanstra #39041 #39042 / Duplicate of #

emmron avatar Jul 13 '24 15:07 emmron

@emmron This PR is very large and unwieldy, updates unrelated code, and it isn't clear to me what it's solving. To be honest it looks like it may even have been AI generated, and it looks very similar to https://github.com/gatsbyjs/gatsby/pull/39050. I'm going to close it, but please feel free to open smaller, more easily reviewable PRs.

serhalp avatar Oct 29 '24 19:10 serhalp