Finishing an upload primarily entails checking with the GCS API that the file size matches the intent, allocating a file ID, noting it down, and enqueueing a job to do file processing/indexing. (The latter part is complex enough to warrant its own work item—actually two-and-a-half of them, given the vastly different workflows for text and media documents.)
If the file size doesn't match, the file should be deleted from GCS. In either case, the upload intent is deleted before this returns.
All parts apart from indexing are implemented in ff6ceae. That said, I don't think it's wise to close this until the indexing job is kicked off in UploadService at the proper time.
Finishing an upload primarily entails checking with the GCS API that the file size matches the intent, allocating a file ID, noting it down, and enqueueing a job to do file processing/indexing. (The latter part is complex enough to warrant its own work item—actually two-and-a-half of them, given the vastly different workflows for text and media documents.)
If the file size doesn't match, the file should be deleted from GCS. In either case, the upload intent is deleted before this returns.
Depends on #4.