Fix allowUnknownFileEnds in 1.8.0 when importing files with unknown extension#3722
Merged
muxator merged 1 commit intoether:developfrom Mar 17, 2020
tudorconstantin:patch-1
Merged
Fix allowUnknownFileEnds in 1.8.0 when importing files with unknown extension#3722muxator merged 1 commit intoether:developfrom tudorconstantin:patch-1
muxator merged 1 commit intoether:developfrom
tudorconstantin:patch-1
Conversation
… allowUnknownFileEnds is true By specification, when settings.allowUnknownFileEnds is true and the user tries to import a file with an unknown extension (this includes no extension), Etherpad tries to import it as txt. This broke in Etherpad 1.8.0, that abruptly terminates the processing with an UnhandledPromiseRejectionWarning. This patch restores the intended behaviour, and allows to import as text a file with an unknown extension (on no extension). In order to catch the UnhandledPromiseRejectionWarning we had to use fsp_rename(), which is declared earlier in the code and is promised based instead of fs.rename(), which is callback based. Fixes #3710.
Contributor
This was referenced Mar 17, 2020
Closed
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.
fs.rename()is callback based, we needfsp_rename()which is declared above and is promised based, in order to catch theunhandled promised rejection ...warningPS: I haven't tested this at all. I was looking at what kind of issues are open for this project and this one seems the obvious fix. Also, sorry if this PR is useless, feel free to close it, especially if it causes more work for integrating it than it helps.