nwutils / nw-builder

Build NW.js applications for Linux, MacOS and Windows

Home Page:http://nwutils.io/nw-builder/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cache never expires

sysrage opened this issue · comments

Issue Type

  • Bug Report
  • Feature Request
  • Other

Current/Missing Behaviour

If you have an old manifest.json file in your cache directory, it's never updated. So, if a new version of NW.js comes out builds will fail.

Expected/Proposed Behaviour

If using a cache, it needs to expire at some point.

Additional Info

  • Package version: 4.1.1

would it be an acceptable fix to always download manifest.json? It's very lightweight and shouldn't be cached anyways. I can work on a PR if the fix sounds good to you @tharatau .

@williamwang96 My motivation for caching manifest.json was to allow builds without network (if the relevant nw binary is already downladed, that is). Ideally we should redownload manifest.json when connected to network and not redownload while not connected to network (so that builds don't fail).

Update: Feel free to open a PR!

@ayushmanchhabra this still seems to be a problem. I just updated my package.json to NW version 0.77.0-sdk and observed the following error:

[ ERROR ] 2023-06-20T14:33:26.951Z The specified version does not exist in the version manifest. Disable cache to redownload the version manifest. If you still get this error, that means the version you've specified is incorrect.

Deleting cache\manifest.json resolves the issue. Please fix this caching implementation...

My motivation for caching manifest.json was to allow builds without network (if the relevant nw binary is already downladed, that is).

You need to actually try to update the cache, though. Only use the existing manifest.json if a new download was unsuccessful. Otherwise, it should be re-written with the latest version.