@openneuro/server 4.31.0-alpha.1 → 4.31.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openneuro/server",
3
- "version": "4.31.0-alpha.1",
3
+ "version": "4.31.1",
4
4
  "description": "Core service for the OpenNeuro platform.",
5
5
  "license": "MIT",
6
6
  "main": "src/server.js",
@@ -21,7 +21,7 @@
21
21
  "@elastic/elasticsearch": "8.13.1",
22
22
  "@graphql-tools/schema": "^10.0.0",
23
23
  "@keyv/redis": "^2.7.0",
24
- "@openneuro/search": "^4.31.0-alpha.1",
24
+ "@openneuro/search": "^4.31.1",
25
25
  "@sentry/node": "^8.25.0",
26
26
  "@sentry/profiling-node": "^8.25.0",
27
27
  "base64url": "^3.0.0",
@@ -85,5 +85,5 @@
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "48a348e9accee0109c46516b704b643a2d5b4f4b"
88
+ "gitHead": "9d22560adb2cf8afdb384e767c4c80a4cb0da23e"
89
89
  }
@@ -22,14 +22,19 @@ export const validation = async (dataset, _, { userInfo }) => {
22
22
  { userInfo },
23
23
  )
24
24
  }
25
- // Return with errors and warning counts appended
26
- return {
27
- ...data.toObject(),
28
- errors: data.issues.filter((issue) =>
29
- issue.severity === "error"
30
- ).length,
31
- warnings:
32
- data.issues.filter((issue) => issue.severity === "warning").length,
25
+ if (data) {
26
+ // Return with errors and warning counts appended
27
+ return {
28
+ ...data.toObject(),
29
+ errors: data.issues.filter((issue) =>
30
+ issue.severity === "error"
31
+ ).length,
32
+ warnings: data.issues.filter((issue) =>
33
+ issue.severity === "warning"
34
+ ).length,
35
+ }
36
+ } else {
37
+ return null
33
38
  }
34
39
  })
35
40
  }
@@ -43,13 +48,19 @@ export const snapshotValidation = async (snapshot) => {
43
48
  id: snapshot.hexsha,
44
49
  datasetId,
45
50
  }).exec()
46
- // Return with errors and warning counts appended
47
- return {
48
- ...validation.toObject(),
49
- errors:
50
- validation.issues.filter((issue) => issue.severity === "error").length,
51
- warnings:
52
- validation.issues.filter((issue) => issue.severity === "warning").length,
51
+ if (validation) {
52
+ // Return with errors and warning counts appended
53
+ return {
54
+ ...validation.toObject(),
55
+ errors: validation.issues.filter((issue) =>
56
+ issue.severity === "error"
57
+ ).length,
58
+ warnings:
59
+ validation.issues.filter((issue) => issue.severity === "warning")
60
+ .length,
61
+ }
62
+ } else {
63
+ return null
53
64
  }
54
65
  }
55
66