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
F3376766: D5240.diff
Wed, Nov 27, 2:03 AM
Unknown Object (File)
Mon, Nov 25, 10:19 PM
Unknown Object (File)
Mon, Nov 25, 10:19 PM
Unknown Object (File)
Mon, Nov 25, 10:19 PM
Unknown Object (File)
Mon, Nov 25, 10:18 PM
Unknown Object (File)
Oct 28 2024, 3:23 AM
Unknown Object (File)
Oct 28 2024, 3:23 AM
Unknown Object (File)
Oct 28 2024, 3:23 AM
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