diff --git a/src/libs/actions/PersistedRequests.ts b/src/libs/actions/PersistedRequests.ts index c4df73067659..894adf78f735 100644 --- a/src/libs/actions/PersistedRequests.ts +++ b/src/libs/actions/PersistedRequests.ts @@ -1,3 +1,4 @@ +import cloneDeep from 'lodash/cloneDeep'; import isEqual from 'lodash/isEqual'; import Onyx from 'react-native-onyx'; import Log from '@libs/Log'; @@ -60,7 +61,7 @@ function endRequestAndRemoveFromQueue(requestToRemove: Request) { * We only remove the first matching request because the order of requests matters. * If we were to remove all matching requests, we can end up with a final state that is different than what the user intended. */ - const requests = [...persistedRequests]; + const requests = cloneDeep(persistedRequests); const index = requests.findIndex((persistedRequest) => isEqual(persistedRequest, requestToRemove)); if (index !== -1) {