Skip to content

Fix allowUnknownFileEnds in 1.8.0 when importing files with unknown extension#3722

Merged
muxator merged 1 commit intoether:developfrom
tudorconstantin:patch-1
Mar 17, 2020
Merged

Fix allowUnknownFileEnds in 1.8.0 when importing files with unknown extension#3722
muxator merged 1 commit intoether:developfrom
tudorconstantin:patch-1

Conversation

@tudorconstantin
Copy link
Copy Markdown
Contributor

fs.rename() is callback based, we need fsp_rename() which is declared above and is promised based, in order to catch the unhandled promised rejection ... warning

PS: 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.

… 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.
@muxator muxator changed the title fix for #3710 Fix allowUnknownFileEnds in 1.8.0 when importing files with unknown extension (#3710) Mar 17, 2020
@muxator muxator changed the title Fix allowUnknownFileEnds in 1.8.0 when importing files with unknown extension (#3710) Fix allowUnknownFileEnds in 1.8.0 when importing files with unknown extension Mar 17, 2020
@muxator
Copy link
Copy Markdown
Contributor

muxator commented Mar 17, 2020

Queued, thanks.

This closes #3710 and replaces #3718.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants