Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert from streaming form *before* any changes to file size #6807

Merged
merged 7 commits into from
Jul 28, 2023

Conversation

finnschiermer
Copy link
Contributor

@finnschiermer finnschiermer commented Jul 19, 2023

We changed (in v12.12.0) how we attach files in order to give better errors. Unfortunately this can lead to scenarios in which a file on streaming format (as produced by compact on launch or copy to file) is truncated or expanded before conversion to normal (non-streaming) format. If the app is then terminated (for whatever reason) we can no longer find the file footer and do the conversion later. The end result is a corrupted file - either the footer is lost or it is no longer at the end of the file, as expected.

This PR retains the better error reporting, while only doing file size changing operations after the conversion to normal format.

In response to: realm/realm-kotlin#1440

@jedelbo jedelbo merged commit 86a2289 into master Jul 28, 2023
@jedelbo jedelbo deleted the fsa/fix-attach_file-issues branch July 28, 2023 10:45
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants