@percy/core 1.32.13-beta.0 → 1.32.13-beta.2

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.
Files changed (2) hide show
  1. package/dist/api.js +13 -2
  2. package/package.json +10 -10
package/dist/api.js CHANGED
@@ -237,9 +237,20 @@ export function createPercyServer(percy, port) {
237
237
  .route('post', '/percy/snapshot', async (req, res) => {
238
238
  let data;
239
239
  const snapshotPromise = {};
240
+ const isAsync = req.url.searchParams.has('async');
240
241
  const snapshot = percy.snapshot(req.body, snapshotPromise);
241
- if (!req.url.searchParams.has('async')) await snapshot;
242
- if (percy.syncMode(req.body)) data = await handleSyncJob(snapshotPromise[req.body.name], percy, 'snapshot');
242
+ if (!isAsync) await snapshot;
243
+ if (percy.syncMode(req.body)) {
244
+ if (isAsync) {
245
+ // the sync job is only registered once the snapshot has been processed
246
+ logger('core:server').warn('Sync mode results are not available for async snapshot requests');
247
+ data = {
248
+ error: 'Sync mode is not supported with the async parameter'
249
+ };
250
+ } else {
251
+ data = await handleSyncJob(snapshotPromise[req.body.name], percy, 'snapshot');
252
+ }
253
+ }
243
254
  return res.json(200, {
244
255
  success: true,
245
256
  data: data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.32.13-beta.0",
3
+ "version": "1.32.13-beta.2",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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.13-beta.0",
50
- "@percy/config": "1.32.13-beta.0",
51
- "@percy/dom": "1.32.13-beta.0",
52
- "@percy/logger": "1.32.13-beta.0",
53
- "@percy/monitoring": "1.32.13-beta.0",
54
- "@percy/webdriver-utils": "1.32.13-beta.0",
49
+ "@percy/client": "1.32.13-beta.2",
50
+ "@percy/config": "1.32.13-beta.2",
51
+ "@percy/dom": "1.32.13-beta.2",
52
+ "@percy/logger": "1.32.13-beta.2",
53
+ "@percy/monitoring": "1.32.13-beta.2",
54
+ "@percy/webdriver-utils": "1.32.13-beta.2",
55
55
  "adm-zip": "^0.6.0",
56
56
  "busboy": "^1.6.0",
57
57
  "content-disposition": "^0.5.4",
@@ -67,8 +67,8 @@
67
67
  "yaml": "^2.4.1"
68
68
  },
69
69
  "optionalDependencies": {
70
- "@percy/cli-doctor": "1.32.13-beta.0",
71
- "@percy/cli-pdf": "1.32.13-beta.0"
70
+ "@percy/cli-doctor": "1.32.13-beta.2",
71
+ "@percy/cli-pdf": "1.32.13-beta.2"
72
72
  },
73
- "gitHead": "0932920f43e26a8a5c39c356ff5fbd8cc6cfc598"
73
+ "gitHead": "dcca431a742a923312777825e05af9ac01706213"
74
74
  }