@overmap-ai/core 1.0.15 → 1.0.16-fix-misc-issues.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.
package/dist/overmap-core.js
CHANGED
|
@@ -21,6 +21,8 @@ import ColorCls from "color";
|
|
|
21
21
|
import jwtDecode from "jwt-decode";
|
|
22
22
|
import { RESET_STATE } from "@redux-offline/redux-offline/lib/constants";
|
|
23
23
|
import { openDB } from "idb";
|
|
24
|
+
const debugLog = (...args) => {
|
|
25
|
+
};
|
|
24
26
|
class OutboxCoordinator {
|
|
25
27
|
constructor() {
|
|
26
28
|
__publicField(this, "graph");
|
|
@@ -91,6 +93,7 @@ class OutboxCoordinator {
|
|
|
91
93
|
continue;
|
|
92
94
|
const details = this.graph.getNodeData(node);
|
|
93
95
|
if (request2.payload.blockers.some((blocker) => details.payload.blocks.includes(blocker))) {
|
|
96
|
+
debugLog("Adding dependency from", request2.payload.uuid, "to", node);
|
|
94
97
|
this._addDependency(request2.payload.uuid, node);
|
|
95
98
|
}
|
|
96
99
|
}
|
|
@@ -142,9 +145,11 @@ class OutboxCoordinator {
|
|
|
142
145
|
*/
|
|
143
146
|
peek() {
|
|
144
147
|
const nextNode = this._getNextNode();
|
|
145
|
-
if (!nextNode)
|
|
148
|
+
if (!nextNode) {
|
|
146
149
|
return void 0;
|
|
147
|
-
|
|
150
|
+
}
|
|
151
|
+
const ret = this.graph.getNodeData(nextNode);
|
|
152
|
+
return ret;
|
|
148
153
|
}
|
|
149
154
|
/**
|
|
150
155
|
* Removes a request from the graph. This should be called when a request is successfully sent.
|
|
@@ -201,6 +206,7 @@ class OutboxCoordinator {
|
|
|
201
206
|
}
|
|
202
207
|
registerRetry(uuid) {
|
|
203
208
|
this.requestAttemptCounter[uuid] = (this.requestAttemptCounter[uuid] || 0) + 1;
|
|
209
|
+
debugLog("Registered retry for request:", uuid, "with", this.requestAttemptCounter[uuid], "attempts");
|
|
204
210
|
}
|
|
205
211
|
}
|
|
206
212
|
class APIError extends Error {
|
|
@@ -2117,7 +2123,7 @@ const searchIssues = restructureCreateSelectorWithArgs(
|
|
|
2117
2123
|
issue.offline_id,
|
|
2118
2124
|
"warn",
|
|
2119
2125
|
`Encountered issue with an index_workspace that doesn't exist. Issue ${issue.offline_id} has
|
|
2120
|
-
index_workspace = ${issue.index_workspace},
|
|
2126
|
+
index_workspace = ${issue.index_workspace}, which does not exist in:`,
|
|
2121
2127
|
Object.keys(workspaceMapping)
|
|
2122
2128
|
);
|
|
2123
2129
|
continue;
|
|
@@ -3301,6 +3307,7 @@ const defaultStore = configureStore({
|
|
|
3301
3307
|
}
|
|
3302
3308
|
});
|
|
3303
3309
|
async function performRequest(action, client) {
|
|
3310
|
+
var _a2;
|
|
3304
3311
|
async function checkToken() {
|
|
3305
3312
|
if (client.auth.tokenIsExpiringSoon()) {
|
|
3306
3313
|
await client.auth.renewTokens();
|
|
@@ -3404,9 +3411,18 @@ async function performRequest(action, client) {
|
|
|
3404
3411
|
throw new APIError("You have been signed out due to inactivity.", originalError, { discard: true });
|
|
3405
3412
|
}
|
|
3406
3413
|
}
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3414
|
+
const apiErrorMessage = (_a2 = originalError.body) == null ? void 0 : _a2.error;
|
|
3415
|
+
throw new APIError(
|
|
3416
|
+
typeof apiErrorMessage === "string" ? apiErrorMessage : (
|
|
3417
|
+
// TODO: Error codes for all APIErrors.
|
|
3418
|
+
// TODO: Constant for all messages.
|
|
3419
|
+
originalError.text || "An unexpected error occurred."
|
|
3420
|
+
),
|
|
3421
|
+
originalError,
|
|
3422
|
+
{
|
|
3423
|
+
discard: discardStatuses.includes(originalError.status)
|
|
3424
|
+
}
|
|
3425
|
+
);
|
|
3410
3426
|
}
|
|
3411
3427
|
}
|
|
3412
3428
|
class MiddlewareChainerPrivate {
|
|
@@ -5309,7 +5325,7 @@ class UserFormSubmissionService extends BaseApiService {
|
|
|
5309
5325
|
const { store } = this.client;
|
|
5310
5326
|
const projectId = store.getState().projectReducer.activeProjectId;
|
|
5311
5327
|
const submissions = await this.enqueueRequest({
|
|
5312
|
-
description: "Fetch
|
|
5328
|
+
description: "Fetch form submissions",
|
|
5313
5329
|
method: HttpMethod.GET,
|
|
5314
5330
|
url: `/forms/in-project/${projectId}/submissions/`,
|
|
5315
5331
|
blockers: [],
|
|
@@ -5317,7 +5333,7 @@ class UserFormSubmissionService extends BaseApiService {
|
|
|
5317
5333
|
});
|
|
5318
5334
|
store.dispatch(setUserFormSubmissions(submissions));
|
|
5319
5335
|
const attachments = await this.enqueueRequest({
|
|
5320
|
-
description: "Fetch
|
|
5336
|
+
description: "Fetch form attachments",
|
|
5321
5337
|
method: HttpMethod.GET,
|
|
5322
5338
|
url: `/forms/in-project/${projectId}/attachments/`,
|
|
5323
5339
|
blockers: [],
|