@overmap-ai/core 1.0.16-fix-misc-issues.5 → 1.0.16-fix-misc-issues.7
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.
|
@@ -3309,16 +3309,22 @@ var __publicField = (obj, key, value) => {
|
|
|
3309
3309
|
var _a2;
|
|
3310
3310
|
debugLog("Inside performRequest. Action:", action);
|
|
3311
3311
|
async function checkToken() {
|
|
3312
|
+
console.debug("CHECKING TOKEN");
|
|
3312
3313
|
if (client.auth.tokenIsExpiringSoon()) {
|
|
3314
|
+
console.debug("CHECKING TOKEN: 1");
|
|
3313
3315
|
await client.auth.renewTokens();
|
|
3316
|
+
console.debug("CHECKING TOKEN: 2");
|
|
3314
3317
|
}
|
|
3318
|
+
console.debug("CHECKING TOKEN: 3");
|
|
3315
3319
|
}
|
|
3320
|
+
console.debug("A1");
|
|
3316
3321
|
const state = client.store.getState();
|
|
3317
3322
|
if (state.outboxReducer.deletedRequests.includes(action.payload.uuid)) {
|
|
3318
3323
|
debugLog("Request was marked for deletion; throwing error.");
|
|
3319
3324
|
throw new Error("Request was marked for deletion");
|
|
3320
3325
|
}
|
|
3321
3326
|
await checkToken();
|
|
3327
|
+
console.debug("Done checking tokens");
|
|
3322
3328
|
const defaultSettings = {
|
|
3323
3329
|
queryParams: "",
|
|
3324
3330
|
isAuthNeeded: true
|
|
@@ -3332,10 +3338,12 @@ var __publicField = (obj, key, value) => {
|
|
|
3332
3338
|
let url = requestDetails.url;
|
|
3333
3339
|
const file = attachmentHash ? await client.files.fetchCache(attachmentHash) : void 0;
|
|
3334
3340
|
const accessToken = selectAccessToken(state);
|
|
3341
|
+
console.debug("A");
|
|
3335
3342
|
if (attachmentHash && !file) {
|
|
3336
3343
|
debugLog("Cannot upload uncached attachment:", attachmentHash);
|
|
3337
3344
|
throw new Error(`Cannot upload file ${attachmentHash} because it's not cached.`);
|
|
3338
3345
|
}
|
|
3346
|
+
console.debug("B");
|
|
3339
3347
|
if ((!isExternalUrl || false) && !url.startsWith("http")) {
|
|
3340
3348
|
debugLog("Prepending base URL to relative URL:", url);
|
|
3341
3349
|
if (!url.startsWith("/") && !url.startsWith("blob:")) {
|
|
@@ -3343,6 +3351,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3343
3351
|
}
|
|
3344
3352
|
url = client.API_URL + url;
|
|
3345
3353
|
}
|
|
3354
|
+
console.debug("C");
|
|
3346
3355
|
const addPayload = (req) => {
|
|
3347
3356
|
if (attachmentHash) {
|
|
3348
3357
|
const s3url = requestDetails.s3url;
|
|
@@ -3391,6 +3400,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3391
3400
|
if (headers) {
|
|
3392
3401
|
requestToSend = requestToSend.set(headers);
|
|
3393
3402
|
}
|
|
3403
|
+
console.debug("D");
|
|
3394
3404
|
try {
|
|
3395
3405
|
debugLog("Sending request:", requestDetails, "with params:", queryParams);
|
|
3396
3406
|
return await requestToSend.query(queryParams);
|