From 6bd0501e220d7117be757ba9c1d9695837654273 Mon Sep 17 00:00:00 2001 From: Ionatan Wiznia Date: Thu, 4 May 2023 17:04:00 -0300 Subject: [PATCH 1/2] Improve the many writes error message --- src/libs/HttpUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/HttpUtils.js b/src/libs/HttpUtils.js index db76fb45b0d9..c69b022edd54 100644 --- a/src/libs/HttpUtils.js +++ b/src/libs/HttpUtils.js @@ -96,8 +96,8 @@ function processHTTPRequest(url, method = 'get', body = null, canCancel = true, }); } if (response.jsonCode === CONST.JSON_CODE.MANY_WRITES_ERROR) { - const {phpCommandName, authWriteCommandsCount} = response.data; - const message = `The API call (${phpCommandName}) did ${authWriteCommandsCount - 1} more Auth write requests than allowed. Check the APIWriteCommands class in Web-Expensify`; + const {phpCommandName, authWriteCommands} = response.data; + const message = `The API call (${phpCommandName}) did more Auth write requests than allowed. Commands: ${authWriteCommands.join(', ')}. Check the APIWriteCommands class in Web-Expensify`; alert('Too many auth writes', message); } return response; From bf28e4ea86cfcf8b80dce78ae8e7bd5d25247ba4 Mon Sep 17 00:00:00 2001 From: Ionatan Wiznia Date: Thu, 4 May 2023 17:25:24 -0300 Subject: [PATCH 2/2] Improve log --- src/libs/HttpUtils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/HttpUtils.js b/src/libs/HttpUtils.js index c69b022edd54..489afe7a9791 100644 --- a/src/libs/HttpUtils.js +++ b/src/libs/HttpUtils.js @@ -97,7 +97,8 @@ function processHTTPRequest(url, method = 'get', body = null, canCancel = true, } if (response.jsonCode === CONST.JSON_CODE.MANY_WRITES_ERROR) { const {phpCommandName, authWriteCommands} = response.data; - const message = `The API call (${phpCommandName}) did more Auth write requests than allowed. Commands: ${authWriteCommands.join(', ')}. Check the APIWriteCommands class in Web-Expensify`; + // eslint-disable-next-line max-len + const message = `The API call (${phpCommandName}) did more Auth write requests than allowed. Count ${authWriteCommands.length}, commands: ${authWriteCommands.join(', ')}. Check the APIWriteCommands class in Web-Expensify`; alert('Too many auth writes', message); } return response;