Skip to content

Commit

Permalink
Merge pull request #55395 from shubham1206agra/fix-onyx-file-error
Browse files Browse the repository at this point in the history
Fixed Onyx serialization of FileObject
  • Loading branch information
cristipaval authored Jan 23, 2025
2 parents 7746935 + 3ca19b1 commit 16d5642
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/libs/actions/OnyxUpdates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,14 @@ function apply({lastUpdateID, type, request, response, updates}: OnyxUpdatesFrom
* @param [updateParams.updates] Exists if updateParams.type === 'pusher'
*/
function saveUpdateInformation(updateParams: OnyxUpdatesFromServer) {
let modifiedUpdateParams = updateParams;
// We don't want to store the data in the updateParams if it's a HTTPS update since it is useless anyways
// and it causes serialization issues when storing in Onyx
if (updateParams.type === CONST.ONYX_UPDATE_TYPES.HTTPS && updateParams.request) {
modifiedUpdateParams = {...modifiedUpdateParams, request: {...updateParams.request, data: undefined}};
}
// Always use set() here so that the updateParams are never merged and always unique to the request that came in
Onyx.set(ONYXKEYS.ONYX_UPDATES_FROM_SERVER, updateParams);
Onyx.set(ONYXKEYS.ONYX_UPDATES_FROM_SERVER, modifiedUpdateParams);
}

type DoesClientNeedToBeUpdatedParams = {
Expand Down

0 comments on commit 16d5642

Please sign in to comment.