@percy/client 1.32.7-beta.0 → 1.32.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js CHANGED
@@ -406,16 +406,13 @@ export class PercyClient {
406
406
  return this.get(`job_status?sync=true&type=${type}&id=${ids.join()}`);
407
407
  }
408
408
  async getIntelliStorySnapshotNameToCommit(buildId) {
409
- var _this$env$git, _this$env$target, _this$env$git2, _this$env$target2;
410
409
  this.log.debug('IntelliStory: looking up baselines...');
410
+ // `build_id` is the only input. The build already exists by the time this is
411
+ // called, so its base build has been selected server-side and the endpoint
412
+ // reads through to that base build's commit — there is nothing to predict
413
+ // from git/PR context any more.
411
414
  const qs = new URLSearchParams();
412
415
  if (buildId) qs.append('build_id', buildId);
413
- if ((_this$env$git = this.env.git) !== null && _this$env$git !== void 0 && _this$env$git.branch) qs.append('branch', this.env.git.branch);
414
- if ((_this$env$target = this.env.target) !== null && _this$env$target !== void 0 && _this$env$target.branch) qs.append('target_branch', this.env.target.branch);
415
- if ((_this$env$git2 = this.env.git) !== null && _this$env$git2 !== void 0 && _this$env$git2.sha) qs.append('commit_sha', this.env.git.sha);
416
- if ((_this$env$target2 = this.env.target) !== null && _this$env$target2 !== void 0 && _this$env$target2.commit) qs.append('target_commit_sha', this.env.target.commit);
417
- if (this.env.pullRequest != null) qs.append('pull_request_number', String(this.env.pullRequest));
418
- if (this.env.partial) qs.append('partial', 'true');
419
416
  const query = qs.toString();
420
417
  return this.get(query ? `intelli_story/snapshot-name-to-commit?${query}` : 'intelli_story/snapshot-name-to-commit', {
421
418
  identifier: 'intelli_story.snapshot_name_to_commit'
package/dist/utils.js CHANGED
@@ -239,6 +239,17 @@ export async function request(url, options = {}, callback) {
239
239
  let req = http.request(requestOptions);
240
240
  req.on('response', handleResponse);
241
241
  req.on('error', handleError);
242
+
243
+ // Node's `timeout` option only *emits* a 'timeout' event once the socket
244
+ // has been idle that long — it does not abort anything. Without this
245
+ // listener a caller passing `timeout` still waits forever on a peer that
246
+ // accepts the connection and then goes silent, and the promise never
247
+ // settles. Destroying the request surfaces it through 'error' instead.
248
+ if (requestOptions.timeout) {
249
+ req.on('timeout', () => req.destroy(Object.assign(new Error(`Request to ${url} timed out after ${requestOptions.timeout}ms`), {
250
+ code: 'ETIMEDOUT'
251
+ })));
252
+ }
242
253
  req.end(body);
243
254
  }, {
244
255
  retries,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/client",
3
- "version": "1.32.7-beta.0",
3
+ "version": "1.32.7",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public",
12
- "tag": "beta"
12
+ "tag": "latest"
13
13
  },
14
14
  "engines": {
15
15
  "node": ">=14"
@@ -33,11 +33,11 @@
33
33
  "test:coverage": "yarn test --coverage"
34
34
  },
35
35
  "dependencies": {
36
- "@percy/config": "1.32.7-beta.0",
37
- "@percy/env": "1.32.7-beta.0",
38
- "@percy/logger": "1.32.7-beta.0",
36
+ "@percy/config": "1.32.7",
37
+ "@percy/env": "1.32.7",
38
+ "@percy/logger": "1.32.7",
39
39
  "pac-proxy-agent": "^7.0.2",
40
40
  "pako": "^2.1.0"
41
41
  },
42
- "gitHead": "f86a18de3e04d3cfa9d14ce5d186ad66c3f8e020"
42
+ "gitHead": "9352a730c49e19a5abf71e5f3ec635f91c2ab6b9"
43
43
  }