@overmap-ai/core 1.0.65-bulk-form-submit.0 → 1.0.65-error-message-fix.0

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.
@@ -1 +1 @@
1
- export declare const OUTBOX_RETRY_DELAY = 5000;
1
+ export declare const OUTBOX_RETRY_DELAY = 60000;
@@ -229,13 +229,16 @@ const UNKNOWN_ERROR_MESSAGE = "An unknown error occurred";
229
229
  const MAX_ERROR_MESSAGE_LENGTH = 500;
230
230
  const _SPECIAL_KEYS = ["non_field_errors", "detail"];
231
231
  function extractErrorMessage(errorRes, err) {
232
+ console.debug("extracting error message from response", errorRes, err);
232
233
  let ret;
233
234
  if (errorRes == null ? void 0 : errorRes.body) {
234
235
  if (typeof errorRes.body === "object") {
235
236
  const responseBody = errorRes.body;
236
237
  if (typeof responseBody.error === "string") {
238
+ console.debug("body.error is string", responseBody.error);
237
239
  ret = responseBody.error;
238
240
  } else if (typeof responseBody.message === "string") {
241
+ console.debug("body.message is string", responseBody.message);
239
242
  ret = responseBody.message;
240
243
  } else if (responseBody.body) {
241
244
  try {
@@ -252,11 +255,13 @@ function extractErrorMessage(errorRes, err) {
252
255
  }
253
256
  return `${key}: ${JSON.stringify(value)}`;
254
257
  }).join("\n");
258
+ console.debug("parsing error body", ret);
255
259
  } catch (e) {
256
260
  console.error("Failed to extract error message from response body", e);
257
261
  }
258
262
  }
259
263
  } else if (typeof errorRes.body === "string") {
264
+ console.debug("error body is string", errorRes.body);
260
265
  ret = errorRes.body;
261
266
  }
262
267
  } else if (errorRes == null ? void 0 : errorRes.text) {
@@ -657,7 +662,7 @@ const emailRegex = /^.+@.+\..+$/;
657
662
  const fullAssetMarkerSize = 45;
658
663
  const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
659
664
  const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
660
- const OUTBOX_RETRY_DELAY = 5e3;
665
+ const OUTBOX_RETRY_DELAY = 6e4;
661
666
  const EMPTY_ARRAY = Object.freeze([]);
662
667
  let debug = false;
663
668
  const REACT_APP_DEBUG_MEMOIZATION = {}.REACT_APP_DEBUG_MEMOIZATION || "";
@@ -6223,22 +6228,50 @@ class FormSubmissionService extends BaseUploadService {
6223
6228
  }
6224
6229
  }
6225
6230
  async refreshStore(projectId) {
6226
- const submissions = await this.enqueueRequest({
6227
- description: "Fetch form submissions",
6231
+ const formSubmissions = {};
6232
+ const modelSubmissions = await this.enqueueRequest({
6233
+ description: "Fetch model submissions",
6228
6234
  method: HttpMethod.GET,
6229
- url: `/forms/in-project/${projectId}/submissions/`,
6235
+ url: `/forms/in-project/${projectId}/submissions/model/latest/`,
6230
6236
  blockers: [],
6231
6237
  blocks: []
6232
6238
  });
6233
- this.dispatch(initializeFormSubmissions(submissions));
6234
- const attachments = await this.enqueueRequest({
6235
- description: "Fetch form attachments",
6239
+ for (const modelSubmission of modelSubmissions) {
6240
+ formSubmissions[modelSubmission.offline_id] = modelSubmission;
6241
+ }
6242
+ const standaloneSubmissions = await this.enqueueRequest({
6243
+ description: "Fetch standalone submissions",
6244
+ method: HttpMethod.GET,
6245
+ url: `/forms/in-project/${projectId}/submissions/standalone/`,
6246
+ blockers: [],
6247
+ blocks: []
6248
+ });
6249
+ for (const standaloneSubmission of standaloneSubmissions) {
6250
+ formSubmissions[standaloneSubmission.offline_id] = standaloneSubmission;
6251
+ }
6252
+ this.dispatch(initializeFormSubmissions(Object.values(formSubmissions)));
6253
+ const attachments = {};
6254
+ const modelAttachments = await this.enqueueRequest({
6255
+ description: "Fetch model submission attachments",
6236
6256
  method: HttpMethod.GET,
6237
- url: `/forms/in-project/${projectId}/attachments/`,
6257
+ url: `/forms/in-project/${projectId}/attachments/model/latest/`,
6238
6258
  blockers: [],
6239
6259
  blocks: []
6240
6260
  });
6241
- this.dispatch(initializeFormSubmissionAttachments(attachments));
6261
+ for (const modelAttachment of modelAttachments) {
6262
+ attachments[modelAttachment.offline_id] = modelAttachment;
6263
+ }
6264
+ const standaloneAttachments = await this.enqueueRequest({
6265
+ description: "Fetch standalone submission attachments",
6266
+ method: HttpMethod.GET,
6267
+ url: `/forms/in-project/${projectId}/attachments/standalone/`,
6268
+ blockers: [],
6269
+ blocks: []
6270
+ });
6271
+ for (const standaloneAttachent of standaloneAttachments) {
6272
+ attachments[standaloneAttachent.offline_id] = standaloneAttachent;
6273
+ }
6274
+ this.dispatch(initializeFormSubmissionAttachments(Object.values(attachments)));
6242
6275
  }
6243
6276
  }
6244
6277
  class WorkspaceService extends BaseApiService {