@sjcrh/proteinpaint-server 2.81.2-2 → 2.81.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-server",
3
- "version": "2.81.2-2",
3
+ "version": "2.81.3",
4
4
  "type": "module",
5
5
  "description": "a genomics visualization tool for exploring a cohort's genotype and phenotype data",
6
6
  "main": "src/app.js",
@@ -1,4 +1,3 @@
1
- import path from "path";
2
1
  import { run_rust } from "@sjcrh/proteinpaint-rust";
3
2
  import serverconfig from "#src/serverconfig.js";
4
3
  import { get_samples } from "#src/termdb.sql.js";
@@ -178,21 +177,32 @@ function gdcValidateQuery(ds, genome) {
178
177
  );
179
178
  return serverconfig.features.gdcGenes;
180
179
  }
181
- if (!ds.__gdc.doneCaching) {
180
+ if (!ds.__gdc?.doneCaching) {
182
181
  throw "The server has not finished caching the case IDs: try again in about 2 minutes.";
183
182
  }
184
183
  const { host, headers } = ds.getHostHeaders(q);
185
- const url = path.join(host.geneExp, "/gene_expression/gene_selection");
184
+ const url = `${host.geneExp}/gene_expression/gene_selection`;
186
185
  try {
187
- const response = await cachedFetch(url, {
188
- method: "POST",
189
- headers,
190
- body: getGeneSelectionArg(q)
191
- });
186
+ const response = await cachedFetch(
187
+ url,
188
+ {
189
+ method: "POST",
190
+ headers,
191
+ body: getGeneSelectionArg(q)
192
+ },
193
+ {
194
+ // noCache: true, // !!! for testing only !!!
195
+ getErrMessage: (response2) => {
196
+ const body = response2?.body || response2;
197
+ return Array.isArray(body?.gene_selection) ? "" : body?.message || body?.error || JSON.stringify(body);
198
+ }
199
+ }
200
+ );
192
201
  const re = response.body;
193
202
  const genes = [];
194
- if (!Array.isArray(re.gene_selection))
195
- throw "re.gene_selection[] is not array";
203
+ if (!Array.isArray(re.gene_selection)) {
204
+ throw "re.gene_selection[] is not array: " + JSON.stringify(re);
205
+ }
196
206
  for (const i of re.gene_selection) {
197
207
  if (i.gene_id && typeof i.gene_id == "string") {
198
208
  const t = genome.genedb.getNameByAlias.get(i.gene_id);