HomePhabricator
Diffusion Comm 5ba513238828

[native] `await waitForCaptureURIUnload(...)` before disposing of temporary…

Description

[native] await waitForCaptureURIUnload(...) before disposing of temporary video thumbnails

Summary:
We create thumbnails for videos (via ffmpeg) and upload them along with the actual video to the keyserver for video messages.

We want to unlink the temporary file once we're done with it so we don't clutter the user's temporary file directory (eg NSTemporaryDirectory on iOS). We were previously unlinking the temporary file once the video was successfully uploaded, but we should first await waitForCaptureURIUnload(...) to ensure that the image isn't being actively displayed in the UI when we unlink it.

This matches the behavior of captured images and pasted images (we create a temporary copy because we can't count on clipboard contents remaining the same) below (~line 813-836).


Depends on D5216

Test Plan: Set breakpoints, logged URIs/paths, checked URIs/paths to make sure they were unlinked as expected.

Reviewers: tomek, varun, marcin, abosh, ashoat

Reviewed By: tomek

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