Skip to content

stream option is lost in any get request that is streamable #188

@yonguelink

Description

@yonguelink

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions