HomePhabricator
Diffusion Comm 03f0820671a9

[native] Make sure we don't start message creation until thumbnail concludes

Description

[native] Make sure we don't start message creation until thumbnail concludes

Summary:
While testing ENG-7600, I noticed an issue where every time InputStateContainer.componentDidUpdate would run, the thumbnail for the video would get wiped from pendingUploads.

This was happening because the code in getCompletedUploads was erroneously including the pending thumbnail upload as completed, since it wasn't set up to notice it on the Media in the Redux store.

By updating the code in getCompletedUploads to be aware of this, we prevent the code in componentDidUpdate from removing thumbnails from the pendingUploads store. This has the effect of making sure we don't attempt to create the message until the thumbnail upload is concluded. This hasn't ever showed up as a problem probably because the thumbnail upload is always faster than the video upload.

Test Plan: Added some logs of pendingUploads, and made sure that the thumbnail upload was not removed until it actually concluded

Reviewers: atul, bartek

Reviewed By: atul

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D11475

Details