Skip to content

Commit

Permalink
Add a comment explaining 460 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Sep 25, 2024
1 parent 6c42779 commit 0fa776a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libs/actions/OnyxUpdates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ function applyHTTPSOnyxUpdates(request: Request, response: Response) {
return updateHandler(request.successData);
}
if (response.jsonCode !== 200 && request.failureData) {
// 460 jsonCode in Expensify world means "admin required".
// Typically, this would only happen if a user attempts an API command that requires policy admin access when they aren't an admin.
// In this case, we don't want to apply failureData because it will likely result in a RedBrickRoad error on a policy field which is not accessible.
// Meaning that there's a red dot you can't dismiss.
if (response.jsonCode === 460) {
Log.info('[OnyxUpdateManager] Received 460 status code, not applying failure data');
return Promise.resolve();
Expand Down

0 comments on commit 0fa776a

Please sign in to comment.