-
-
Notifications
You must be signed in to change notification settings - Fork 320
Description
We detected the issue when using v3.11.4, but I could reproduce it on the latest release (v4.0.1).
We're simply calling downloadSingleArtifactFile as we implemented it (few months back) with the project ID, the job Id, the artifact to download and the options { stream: true}, but we do not receive a stream. The result is the content of the artifact we wanted to download.
After tracing a little, I noticed wrong/missing parameters:
In RequestHelper.get it sends a generic request:
static get(service, endpoint, options = {}, { stream = false } = {}) {
return RequestHelper.request('get', service, endpoint, options, stream);
}The RequestHelper.request method is defined as:
static request(type, service, endpoint, options = {}, form = false, stream = false) { ... }Leading to a call like this:
RequestHelper.request(type = 'get', service = service, endpoint = endpoint, options = options, form = stream, stream = undefined);Notice how the stream option is placed in the form variable and the stream variable is just never used in this case.
It seems like a simple fix, to call the RequestHelper.request method with something such as this instead:
static get(service, endpoint, options = {}, { stream = false } = {}) {
return RequestHelper.request('get', service, endpoint, options, !stream, stream);
}Or take the form definition in the options upstream?
Anyway, it's sure that right now it does not work.
Thank you