Page MenuHomePhabricator

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

Authored by atul on Sep 27 2022, 9:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 28, 3:23 AM
Unknown Object (File)
Mon, Oct 28, 3:23 AM
Unknown Object (File)
Mon, Oct 28, 3:23 AM
Unknown Object (File)
Mon, Oct 28, 3:23 AM
Unknown Object (File)
Mon, Oct 28, 3:23 AM
Unknown Object (File)
Oct 15 2024, 9:16 AM
Unknown Object (File)
Oct 5 2024, 5:38 PM
Unknown Object (File)
Sep 19 2024, 1:03 PM
Subscribers
None

Details

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.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Added @ashoat as reviewer since we already discussed this IRL and he has the most context... feel free to remove

atul edited the summary of this revision. (Show Details)
atul requested review of this revision.Sep 27 2022, 9:58 AM
This revision is now accepted and ready to land.Sep 28 2022, 10:12 AM