-
-
Notifications
You must be signed in to change notification settings - Fork 48
Description
What needs to be done?
Currently in playground code snippets can be shared through url.
It means that entire code is encoded and added as url parameter.
More details: web/landing/assets/controllers/share_code_controller.js
Our goal is to improve it.
In #2004 we set up cloudflare terraform configuration.
This configuration created an R2 instance for which we are going to create a worker that playground will call and that will be used to:
- generate unique id and return it to the user
- upload code snippet + any datasets uploaded by user to workspace
Then when someone enters the playground with our snippet id, we are going to load to workspace files uploaded into snippet folder (snipped id should be a folder id on R2)
Storage Structure
Files on the storage should be partitioned by days.
/snippets/date=2025-11-11/{snipped_id}/
Default Storage TTL should be 90 days.
Each upload of a snippet should also create a /snippets/date=2025-11-11/snippet.js metadata file in which we gonna store:
- precise snippet timestamp
- list of all snippet files
- total size of the snippet (sum of snippet files)
Limitations
In general we want to allow users to upload only:
- code snippet up to 1Mb
- 3 datasets each up to 2mb
So during one submission user should be able to upload only 4 files of total size 7Mb.
Rate Limits
- During one minute user should be able to do 5 submissions
- During one hour user should be able to do 50 submissions
- During 24 hours user should be able to do 100 submissions
Metadata
Metadata
Assignees
Labels
Type
Projects
Status