From 8e5e26c63c3a5ad77db83fd189ba52c730cbcf02 Mon Sep 17 00:00:00 2001 From: diosmosis Date: Wed, 11 Sep 2024 12:22:37 -0700 Subject: [PATCH] remove debugging code --- src/auth.ts | 4 ---- src/error.ts | 1 - tests/appscript/api.spec.ts | 1 + 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/auth.ts b/src/auth.ts index 78d872c..2ddfcef 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -18,15 +18,12 @@ export function getAuthType() { export function checkForValidCreds(instanceUrl?: string, token?: string) { try { - console.log('checking4', instanceUrl, token); const responseContent = Api.fetch('SitesManager.getSitesIdWithAtLeastViewAccess', {}, { instanceUrl, token, }); - console.log('checking4', responseContent, Array.isArray(responseContent), !!responseContent.length); return Array.isArray(responseContent) && !!responseContent.length; } catch (error) { - console.log('checking4', error.message, error.stack); debugLog('checkForValidCreds:', 'failed to get sites ID with parameters', error.stack || error.message); return false; } @@ -38,7 +35,6 @@ export function setCredentials(request) { const instanceUrl = username; const isValidCreds = checkForValidCreds(instanceUrl, token); - console.log('checking4', instanceUrl, token, isValidCreds); if (!isValidCreds) { return { diff --git a/src/error.ts b/src/error.ts index bf56fd3..d30fcc4 100644 --- a/src/error.ts +++ b/src/error.ts @@ -38,7 +38,6 @@ export function throwUserError(message: string) { */ export function throwUnexpectedError(message: string) { try { - console.log('checking4', 'error!', message); const time = (new Date()).toString(); const wholeMessage = `An error has occurred - if you need help, please reach out in the Forums here: ${FORUM_URL} or ` + `contact us by email at hello@matomo.org (in your message, please use Looker Studio in the subject, and copy paste the error message). ` diff --git a/tests/appscript/api.spec.ts b/tests/appscript/api.spec.ts index a143c9e..5b0ed1c 100644 --- a/tests/appscript/api.spec.ts +++ b/tests/appscript/api.spec.ts @@ -171,6 +171,7 @@ describe('api', () => { }, }); + // waiting seems to be required here, or the mock server isn't used in time await new Promise((resolve) => setTimeout(resolve, 5000)); // use the mock server's path that forces a non-random error