@percy/core 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/percy.js CHANGED
@@ -646,10 +646,18 @@ export class Percy {
646
646
  return async function* () {
647
647
  let server;
648
648
  try {
649
- // Check SDK version
649
+ // Check SDK version. This generator runs inside the POST /percy/snapshot
650
+ // request handler (see api.js), so anything awaited here delays the HTTP
651
+ // response the SDK is blocked on. checkSDKVersion reaches out to
652
+ // api.github.com — an unrelated third party that a corporate proxy,
653
+ // egress firewall or GitHub throttling can leave hanging — so it must
654
+ // never gate a snapshot. Set the flag first so exactly one check is ever
655
+ // started (it used to be set after the await, which meant every snapshot
656
+ // posted during a slow check started its own), and run it detached:
657
+ // checkSDKVersion swallows its own errors and only logs.
650
658
  if (!this.sdkInfoDisplayed && options.clientInfo) {
651
- await checkSDKVersion(options.clientInfo);
652
659
  this.sdkInfoDisplayed = true;
660
+ checkSDKVersion(options.clientInfo);
653
661
  }
654
662
  if ('serve' in options) {
655
663
  // create and start a static server
package/dist/utils.js CHANGED
@@ -952,6 +952,12 @@ export async function* maybeScrollToBottom(page, discovery) {
952
952
  }
953
953
  }
954
954
 
955
+ // How long the (purely informational) SDK version check may spend talking to
956
+ // api.github.com before it gives up. Kept short deliberately: the check now runs
957
+ // detached, so its socket is a live handle that would otherwise hold the event
958
+ // loop open at shutdown for as long as the peer stays silent.
959
+ const SDK_VERSION_CHECK_TIMEOUT = 5000;
960
+
955
961
  // Package to GitHub repo mapping
956
962
  const PACKAGE_TO_REPO = {
957
963
  '@percy/selenium-webdriver': 'percy-selenium-js',
@@ -994,11 +1000,15 @@ export async function checkSDKVersion(clientInfo) {
994
1000
  return;
995
1001
  }
996
1002
 
997
- // Fetch latest version from GitHub releases
1003
+ // Fetch latest version from GitHub releases. api.github.com is a third
1004
+ // party we don't control and networks routinely black-hole it (proxies,
1005
+ // egress firewalls, rate limiting), so this is bounded — without a timeout
1006
+ // the socket stays open for the life of the CLI process.
998
1007
  const githubData = await request(`https://api.github.com/repos/percy/${repoName}/releases?page=1`, {
999
1008
  headers: {
1000
1009
  'User-Agent': '@percy/cli'
1001
1010
  },
1011
+ timeout: SDK_VERSION_CHECK_TIMEOUT,
1002
1012
  retries: 0
1003
1013
  });
1004
1014
  const latestRelease = githubData.find(r => !r.prerelease);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
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"
@@ -46,12 +46,12 @@
46
46
  "dependencies": {
47
47
  "@grpc/grpc-js": "^1.14.3",
48
48
  "@grpc/proto-loader": "^0.8.0",
49
- "@percy/client": "1.32.7-beta.0",
50
- "@percy/config": "1.32.7-beta.0",
51
- "@percy/dom": "1.32.7-beta.0",
52
- "@percy/logger": "1.32.7-beta.0",
53
- "@percy/monitoring": "1.32.7-beta.0",
54
- "@percy/webdriver-utils": "1.32.7-beta.0",
49
+ "@percy/client": "1.32.7",
50
+ "@percy/config": "1.32.7",
51
+ "@percy/dom": "1.32.7",
52
+ "@percy/logger": "1.32.7",
53
+ "@percy/monitoring": "1.32.7",
54
+ "@percy/webdriver-utils": "1.32.7",
55
55
  "adm-zip": "^0.6.0",
56
56
  "busboy": "^1.6.0",
57
57
  "content-disposition": "^0.5.4",
@@ -67,7 +67,7 @@
67
67
  "yaml": "^2.4.1"
68
68
  },
69
69
  "optionalDependencies": {
70
- "@percy/cli-doctor": "1.32.7-beta.0"
70
+ "@percy/cli-doctor": "1.32.7"
71
71
  },
72
- "gitHead": "f86a18de3e04d3cfa9d14ce5d186ad66c3f8e020"
72
+ "gitHead": "9352a730c49e19a5abf71e5f3ec635f91c2ab6b9"
73
73
  }