@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.
@@ -3321,16 +3321,22 @@ async function performRequest(action, client) {
3321
3321
  var _a2;
3322
3322
  debugLog("Inside performRequest. Action:", action);
3323
3323
  async function checkToken() {
3324
+ console.debug("CHECKING TOKEN");
3324
3325
  if (client.auth.tokenIsExpiringSoon()) {
3326
+ console.debug("CHECKING TOKEN: 1");
3325
3327
  await client.auth.renewTokens();
3328
+ console.debug("CHECKING TOKEN: 2");
3326
3329
  }
3330
+ console.debug("CHECKING TOKEN: 3");
3327
3331
  }
3332
+ console.debug("A1");
3328
3333
  const state = client.store.getState();
3329
3334
  if (state.outboxReducer.deletedRequests.includes(action.payload.uuid)) {
3330
3335
  debugLog("Request was marked for deletion; throwing error.");
3331
3336
  throw new Error("Request was marked for deletion");
3332
3337
  }
3333
3338
  await checkToken();
3339
+ console.debug("Done checking tokens");
3334
3340
  const defaultSettings = {
3335
3341
  queryParams: "",
3336
3342
  isAuthNeeded: true
@@ -3344,10 +3350,12 @@ async function performRequest(action, client) {
3344
3350
  let url = requestDetails.url;
3345
3351
  const file = attachmentHash ? await client.files.fetchCache(attachmentHash) : void 0;
3346
3352
  const accessToken = selectAccessToken(state);
3353
+ console.debug("A");
3347
3354
  if (attachmentHash && !file) {
3348
3355
  debugLog("Cannot upload uncached attachment:", attachmentHash);
3349
3356
  throw new Error(`Cannot upload file ${attachmentHash} because it's not cached.`);
3350
3357
  }
3358
+ console.debug("B");
3351
3359
  if ((!isExternalUrl || false) && !url.startsWith("http")) {
3352
3360
  debugLog("Prepending base URL to relative URL:", url);
3353
3361
  if (!url.startsWith("/") && !url.startsWith("blob:")) {
@@ -3355,6 +3363,7 @@ async function performRequest(action, client) {
3355
3363
  }
3356
3364
  url = client.API_URL + url;
3357
3365
  }
3366
+ console.debug("C");
3358
3367
  const addPayload = (req) => {
3359
3368
  if (attachmentHash) {
3360
3369
  const s3url = requestDetails.s3url;
@@ -3403,6 +3412,7 @@ async function performRequest(action, client) {
3403
3412
  if (headers) {
3404
3413
  requestToSend = requestToSend.set(headers);
3405
3414
  }
3415
+ console.debug("D");
3406
3416
  try {
3407
3417
  debugLog("Sending request:", requestDetails, "with params:", queryParams);
3408
3418
  return await requestToSend.query(queryParams);