New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Delta Update Support #122
Comments
I'm seeing the following error when a file has been changed: [phonegap] 500 /__api__/update
Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (http.js:690:11)
at ServerResponse.res.setHeader (/Users/mwbrooks/Development/lib/connect-phonegap/node_modules/connect/lib/patch.js:63:22)
at ServerResponse.<anonymous> (/Users/mwbrooks/Development/lib/connect-phonegap/node_modules/connect/lib/patch.js:80:14)
at Array.forEach (native)
at ServerResponse.res.writeHead (/Users/mwbrooks/Development/lib/connect-phonegap/node_modules/connect/lib/patch.js:79:28)
at null.<anonymous> (/Users/mwbrooks/Development/lib/connect-phonegap/lib/middleware/update.js:65:21)
at emit (events.js:117:20)
at Archiver.append (/Users/mwbrooks/Development/lib/connect-phonegap/node_modules/archiver/lib/core.js:310:10)
at Object.handle (/Users/mwbrooks/Development/lib/connect-phonegap/lib/middleware/update.js:92:29)
at next (/Users/mwbrooks/Development/lib/connect-phonegap/node_modules/connect/lib/proto.js:193:15) |
The problem is that a new instance of archiver should be created on each creation of an archive. It cannot be reused: |
It's being reused to simplify testing that the archive is properly generated. We could simply to the test to not spy on the internals and instead focus on the input ( For example, the test could take the form: agent.get('/__api__/update')
.expect('content-type', 'application/zip')
.end(function(e, res) {
// parse the response, inspect the ZIP, and ensure the expected files are returned
done();
}); There appears to be some details on reading the response buffer using supertest on this Stackoverflow article: |
Create a separate route that will serve an archive with only the changed files based on the session. When it is unclear what has changed, we can fallback on serving the entire archive (or nothing at all).
A suggestion route would be:
/__api__/app/update
The text was updated successfully, but these errors were encountered: