[Sprint/PinkPanther](fix): Upload cancelling #2083
Closes #2083 Credits to Mark for the elegant solution
Summary
Upload cancellation is broken on production. Go upload a video on it and try to cancel it.
Test
- Upload a video, & whilst uploading, upload a second video - it should replace the existing upload, progress bar should not jump erratically.
- Try cancelling the upload. it should cancel. - Without a refresh, try to upload a second video.
- Uploading a video should complete all the way and post.
- Should not interfere with image upload.
0/1 thread resolved
added MR::Awaiting Review Squad::Yellow scoped labels
changed the description
225 case HttpEventType.Response: 226 return 100; 227 default: 228 return -1; 229 } 230 }) 240 231 ); 241 232 233 if (this.uploadSubscription) this.uploadSubscription.unsubscribe(); 234 235 this.uploadSubscription = uploadProgress$.subscribe(pct => { 236 if (pct >= 0) this.progress.next(pct); 237 }); 238 239 // wait for completion 240 await uploadProgress$.pipe(last()).toPromise(); - Owner
Where is
// Complete the upload await this.clientService.put( `api/v2/media/upload/complete/${lease.media_type}/${lease.guid}`step?
Edited by Mark Harding
added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label