learningequality / learningequality/studio
Migrate web frontend uploads to the GCS resumable scheme
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 191
- Forks
- 307
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 10
Description
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
Migrate the web frontend's upload paths from single-PUT to the opt-in GCS resumable scheme added in #5975, so interrupted uploads resume instead of restarting from byte 0.
Complexity: Medium
Target branch: unstable
Context
Two frontend sites single-PUT the whole file and skip upload when a HEAD on the storage URL returns 200:
contentcuration/frontend/shared/vuex/file/actions.js, inuploadFileToStoragecontentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/services/imageService.js, inuploadFileToStorage
#5975 has landed, so upload_url (with resumable: true) now returns either a definitive skip or a session URI, and the client no longer needs the HEAD check.
The Change
- Pass
resumable: truetoupload_url; upload to the returned session URI in chunks (256 KiB multiples), resuming from the last persisted offset on interruption. - Apply to both upload sites.
- On a definitive skip from
upload_url, mark the file complete without uploading; remove the client HEAD-existence check.
Out of Scope
- Removing single-
PUTand the cutover (#5989). - The ricecooker client (learningequality/ricecooker#678).
Acceptance Criteria
- Both upload sites pass
resumable: trueand upload to the session URI in 256 KiB-multiple chunks. - An interrupted upload resumes from the last persisted offset instead of restarting.
- On a definitive skip from
upload_url, the file is marked complete without uploading; the client HEAD check is removed.
References
- GCS performing resumable uploads: https://docs.cloud.google.com/storage/docs/performing-resumable-uploads
AI usage
I used Claude (Opus 4.8) to draft this issue from the design established in #5975. I defined the scope and acceptance criteria, and verified the named upload paths against the current code.
Revised later with Claude (Opus 5) to put the #5975 prerequisite in past tense now that it has closed, and to resolve the bare out-of-scope references into issue links.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with uploadFileToStorage in contentcuration/frontend/shared/vuex/file/actions.js and contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/services/imageService.js, then read the resumable upload behavior from #5975. Verify both paths use resumable sessions with 256 KiB-multiple chunks, resume interrupted uploads, handle definitive skips, and no longer perform the client HEAD check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, javascript
- Domain
- cloud, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100