budo icon indicating copy to clipboard operation
budo copied to clipboard

occasional stale bundles

Open mattdesl opened this issue 10 years ago • 2 comments

Some users have reported the occasional stale bundle on reload. Will have to investigate.

One thing that could be the culprit is the debounce in watchify-middleware. Might be better to use watchify's delay option.

mattdesl avatar Sep 25 '15 17:09 mattdesl

In [email protected] the --version flag now displays more information about the browserify and watchify versions, which can also affect an issue like this. :smile:

e.g.

$ budo --version
budo v5.1.0
browserify v11.2.0
watchify v3.4.0

mattdesl avatar Sep 25 '15 17:09 mattdesl

I added some tests to watchify-middleware to try and figure this out. Here's what I think is happening:

  • user saves entry file
  • before chokidar has a chance to catch the file change, the user hits Refresh on the browser
  • watchify-middleware sees no change, serves the old bundle
  • then the 'pending' event is fired from chokidar, invalidating the bundle, but it's too late

I'm not sure a clean fix for this. It happens very rarely and probably only through manual reload (as opposed to --live reload). Maybe adding a slight delay to the requests would further minimize the chance of it happening.

mattdesl avatar Sep 26 '15 17:09 mattdesl