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

[Android] writeFile() and some other similar methods should be patched to close their output streams before resolving #35

Closed
birdofpreyru opened this issue Apr 10, 2024 · 0 comments
Labels
P1 High priority issue. Ready Ready for release.

Comments

@birdofpreyru
Copy link
Owner

birdofpreyru commented Apr 10, 2024

Right now these methods use Kotlin's .use method to auto-close a closeable object... but the problem is they resolve their promises inside the execution block, thus the resolution happens before the stream closure.

@birdofpreyru birdofpreyru added the P1 High priority issue. label Apr 10, 2024
birdofpreyru added a commit that referenced this issue Apr 11, 2024
The following methods have been patched:

- appendFile()
- write()
- writeFile()

all they had a similar issue after recent migration to Kotlin: they were
resolving their result promise before closing their output streams, thus
before the written content was guaranteed to be flushed into the
underlyig file system.
@birdofpreyru birdofpreyru added the Ready Ready for release. label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority issue. Ready Ready for release.
Projects
None yet
Development

No branches or pull requests

1 participant