@percy/core 1.26.3-beta.2 → 1.26.3

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/network.js CHANGED
@@ -431,12 +431,16 @@ async function saveResponseResource(network, request) {
431
431
  } else if (!enableJavaScript && !ALLOWED_RESOURCES.includes(request.type)) {
432
432
  return log.debug(`- Skipping disallowed resource type [${request.type}]`, meta);
433
433
  }
434
+ let detectedMime = mime.lookup(response.url);
434
435
  let mimeType =
435
436
  // ensure the mimetype is correct for text/plain responses
436
- response.mimeType === 'text/plain' && mime.lookup(response.url) || response.mimeType;
437
+ response.mimeType === 'text/plain' && detectedMime || response.mimeType;
437
438
 
438
- // font responses from the browser may not be properly encoded, so request them directly
439
- if (mimeType !== null && mimeType !== void 0 && mimeType.includes('font')) {
439
+ // if we detect a font mime, we dont want to override it as different browsers may behave
440
+ // differently for incorrect mimetype in font response, but we want to treat it as a
441
+ // font anyway as font responses from the browser may not be properly encoded,
442
+ // so request them directly.
443
+ if (mimeType !== null && mimeType !== void 0 && mimeType.includes('font') || detectedMime && detectedMime.includes('font')) {
440
444
  log.debug('- Requesting asset directly');
441
445
  body = await makeDirectRequest(network, request);
442
446
  }
package/dist/snapshot.js CHANGED
@@ -417,7 +417,7 @@ export function createSnapshotsQueue(percy) {
417
417
  })
418
418
  // handle possible build errors returned by the API
419
419
  .handle('error', (snapshot, error) => {
420
- var _error$response;
420
+ var _error$response, _error$response2, _error$response2$body;
421
421
  let result = {
422
422
  ...snapshot,
423
423
  error
@@ -437,6 +437,14 @@ export function createSnapshotsQueue(percy) {
437
437
  build.failed = true;
438
438
  queue.close(true);
439
439
  }
440
+ let errors = (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$body = _error$response2.body) === null || _error$response2$body === void 0 ? void 0 : _error$response2$body.errors;
441
+ let duplicate = (errors === null || errors === void 0 ? void 0 : errors.length) > 1 && errors[1].detail.includes('must be unique');
442
+ if (duplicate) {
443
+ if (process.env.PERCY_IGNORE_DUPLICATES !== 'true') {
444
+ percy.log.warn(`Ignored duplicate snapshot. ${errors[1].detail}`);
445
+ }
446
+ return result;
447
+ }
440
448
  percy.log.error(`Encountered an error uploading snapshot: ${name}`, meta);
441
449
  percy.log.error(error, meta);
442
450
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.26.3-beta.2",
3
+ "version": "1.26.3",
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"
@@ -43,10 +43,10 @@
43
43
  "test:types": "tsd"
44
44
  },
45
45
  "dependencies": {
46
- "@percy/client": "1.26.3-beta.2",
47
- "@percy/config": "1.26.3-beta.2",
48
- "@percy/dom": "1.26.3-beta.2",
49
- "@percy/logger": "1.26.3-beta.2",
46
+ "@percy/client": "1.26.3",
47
+ "@percy/config": "1.26.3",
48
+ "@percy/dom": "1.26.3",
49
+ "@percy/logger": "1.26.3",
50
50
  "content-disposition": "^0.5.4",
51
51
  "cross-spawn": "^7.0.3",
52
52
  "extract-zip": "^2.0.1",
@@ -57,5 +57,5 @@
57
57
  "rimraf": "^3.0.2",
58
58
  "ws": "^8.0.0"
59
59
  },
60
- "gitHead": "5e402f5ff469cc521506fef6a347e04a1a2e1434"
60
+ "gitHead": "24150e932f8461869c92a5970c050003cba41f6a"
61
61
  }