Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply Onyx failureData on fetch failure #27650

Merged
merged 12 commits into from
Oct 4, 2023
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
Loading