|
Ran
|
Files
888
|
Run time
31s
|
Badge
README BADGES
|
push
github
feat(bulkProcessing): add audio duration estimate to bulk transcription modal DEV-2255 (#7177) ### đŖ Summary Adds an estimated total time for all selected submissions' audio attachments in the bulk transcription modal. ### đ Notes Implemented with parallel batched requests with exponential backoff if there is a 504. Pseudo-code: ``` for each batch of â¤50 UIDs: attempt = 0 while attempt < 3: POST /api/v2/assets/{asset_uid}/attachments/audio-duration/ if 200 â store results, break if 504 â attempt++, wait, retry if other error â surface error, break if attempt == 3 â abort, surface error aggregate total client-side ``` ### đ Preview steps **In order to test everything, you may want to have the following:** - create ways to generate multiple batches. This can be done with: - `mockobo` to generate many submissions with audio files (> 500) - or you can generate a few, and change the constant in `BulkTranscriptionModal` - return a 504 [here](https://github.com/kobotoolbox/kpi/blob/1e86db2d5/kpi/views/v2/attachment_audio_duration.py#L56-L57) in order to test the retries + exponential backoff 1. âšī¸ have the above ready 2. set the number or rows displayed to 500 3. select all the rows and open the bulk transcription modal 5. đĸ [on PR] notice that there is a `...` until the audio duration loads & the duration is accurate when it does 6. generate the `504` in the backend code 7. Open the bulk transcription modal the say way again 8. đĸ notice that in the network tab, there is maximum 3 tries then a toast after the last try --------- Co-authored-by: James Kiger <james.kiger@gmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Leszek <smutnyleszek@gmail.com>
5879 of 12525 branches covered (46.94%)
21836 of 37034 relevant lines covered (58.96%)
0.59 hits per line
| Coverage | â | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|