Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,6 @@ const CONST = {
BAD_REQUEST: 400,
NOT_AUTHENTICATED: 407,
EXP_ERROR: 666,
MANY_WRITES_ERROR: 665,
UNABLE_TO_RETRY: 'unableToRetry',
UPDATE_REQUIRED: 426,
},
Expand Down
15 changes: 6 additions & 9 deletions src/libs/HttpUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,12 @@ function processHTTPRequest(url: string, method: RequestType = 'get', body: Form
});
}

if (response.jsonCode === CONST.JSON_CODE.MANY_WRITES_ERROR) {
if (response.data) {
const {phpCommandName, authWriteCommands} = response.data;
// 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);
}
if (response.data && (response.data?.authWriteCommands?.length ?? 0)) {
const {phpCommandName, authWriteCommands} = response.data;
const message = `The API command ${phpCommandName} is doing too many Auth writes. Count ${authWriteCommands.length}, commands: ${authWriteCommands.join(
', ',
)}. If you modified this command, you MUST refactor it to remove the extra Auth writes. Otherwise, update the allowed write count in Web-Expensify APIWriteCommands.`;
alert('Too many auth writes', message);
}
if (response.jsonCode === CONST.JSON_CODE.UPDATE_REQUIRED) {
// Trigger a modal and disable the app as the user needs to upgrade to the latest minimum version to continue
Expand Down