Writing binary files - #1171
Closed
loiswells97 wants to merge 56 commits into
Closed
Conversation
…ting pyodide filesystem straightaway
loiswells97
temporarily deployed
to
previews/1171/merge
March 19, 2025 17:37 — with
GitHub Actions
Inactive
loiswells97
temporarily deployed
to
previews/1171/merge
March 20, 2025 09:22 — with
GitHub Actions
Inactive
loiswells97
temporarily deployed
to
previews/1171/merge
April 2, 2025 13:35 — with
GitHub Actions
Inactive
loiswells97
temporarily deployed
to
previews/1171/merge
April 3, 2025 09:38 — with
GitHub Actions
Inactive
loiswells97
temporarily deployed
to
previews/1171/merge
April 16, 2025 14:20 — with
GitHub Actions
Inactive
loiswells97
temporarily deployed
to
previews/1171/merge
April 16, 2025 15:32 — with
GitHub Actions
Inactive
loiswells97
temporarily deployed
to
previews/1171/merge
April 30, 2025 12:38 — with
GitHub Actions
Inactive
loiswells97
temporarily deployed
to
previews/1171/merge
June 11, 2025 08:45 — with
GitHub Actions
Inactive
loiswells97
temporarily deployed
to
previews/1171/merge
June 11, 2025 16:24 — with
GitHub Actions
Inactive
loiswells97
temporarily deployed
to
previews/1171/merge
July 9, 2025 10:50 — with
GitHub Actions
Inactive
Contributor
|
This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Contributor
|
This PR was closed because it has been open for more than 30 days with no activity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At the moment, the batching means that when an image is created, the main thread interprets that as separate images and creates a bunch of invalid files with the same name. To stop this happening, we probably need to modify the response on the frontend to ensure that the batched writes all hit the same file and append to rather than overwrite the existing content. The question we will have is when do we want existing files to be overwritten and when do we want them to be appended to and how can we tell? For example, if it's another batch of binary from the same request then we might want it to append, whereas if it's another request from the user, we might want it to overwrite. Maybe we need some metadata to give a unique ID to the request?
Question: How do we want to deal with image files created by a user who is not logged in? Do we want to let them save the image to the bucket anyway? Or should it be saved in localStorage somehow? An MVP option could be to tell them they have to log in to add images to the project, although not ideal.
Also, we may need some changes on the API side to stop writing to a filename that already exists creating multiple files with the same name in the same project. Can we have an update image endpoint as well as a create image endpoint? And if so, would we overwrite the original image in the bucket? In other words, how would this work in practice?
Work out why updating an image only works after the page has been reloaded, otherwise it creates a second image with the same name.