Repository navigation
Conversation
…ansfers Artifacts.ReadStream went through the typed JSON path, which is wrong for a file of arbitrary type and size: - a JSON file was decoded as the response envelope, so Raw came back empty (or, if it looked like an error envelope, as an API error); - Raw is capped at 10MB, so larger files were silently truncated; - http.Client.Timeout (30s by default) also bounds reading the body. The generator now skips artifact-read-stream, and the hand-written Artifacts.Download(ctx, token) returns the live body for the caller to copy. Byte transfers (file upload, file download, session export, session subscribe) now share one transferClient: the configured client without an overall timeout, so a long but healthy transfer is not cut off. Callers bound them with ctx. JSON calls keep the client timeout.
…t scope sanitizeURL only redacted app_key, so the t token of an artifact download (valid 5 minutes) reached request logs. WithTimeout/WithHTTPClient now state that their timeout bounds JSON calls only; byte transfers are bounded by ctx.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Artifacts.ReadStream(GET/safari/artifact/stream) was generated on the typed JSON path. That path is wrong for a file whose type and size are arbitrary:processResponsedecodes a JSON body as the response envelope, soRawcomes back empty. A JSON file shaped like an error envelope is reported as an API error.Rawis read throughio.LimitReader(maxResponseBodySize).http.Client.Timeout(30s by default) also bounds reading the body, so any transfer longer than 30s fails, even a healthy one. The same applies to uploads and toSessions.Export.Change
artifact-read-stream. A hand-writtenArtifacts.Download(ctx, token)returns the live body as anio.ReadCloser.resp.Header.*ErrorResponse.Timeout.transferClient(): the configured client withTimeout = 0, sharing its Transport (so custom dialers and retry transports still apply). Callers bound these withctx. Byte transfers are file upload, file download, session export and session subscribe.Sessions.Subscribealready copied the client without its timeout inline. It now uses the same helper.openStreamtakes a method, so GET streams use it too.Breaking:
Artifacts.ReadStreamandArtifactsReadStreamRequestare removed. UseArtifacts.Download.Verification
go test ./...passes.golangci-lintv2.13.0 reports 0 issues.WithTimeout(50ms);*ErrorResponsewith a nil body.