Skip to content

Commit

Permalink
Merge pull request #27650 from Expensify/cmartins-fixFailedToFetch
Browse files Browse the repository at this point in the history
Apply Onyx failureData on fetch failure
  • Loading branch information
tgolen authored Oct 4, 2023
2 parents d9a603d + 6a40f69 commit 743a041
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/libs/Middleware/SaveResponseInOnyx.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ const requestsToIgnoreLastUpdateID = ['OpenApp', 'ReconnectApp', 'GetMissingOnyx
*/
function SaveResponseInOnyx(requestResponse, request) {
return requestResponse
.then((response) => {
// Make sure we have response data (i.e. response isn't a promise being passed down to us by a failed retry request and response undefined)
if (!response) {
return;
}
.then((response = {}) => {
const onyxUpdates = response.onyxData;

// Sometimes we call requests that are successfull but they don't have any response or any success/failure data to set. Let's return early since
Expand Down

0 comments on commit 743a041

Please sign in to comment.