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

Uncaught exception while creating folder hierarchy #21

Open
ntma opened this issue Jun 3, 2020 · 6 comments
Open

Uncaught exception while creating folder hierarchy #21

ntma opened this issue Jun 3, 2020 · 6 comments

Comments

@ntma
Copy link

ntma commented Jun 3, 2020

Hi tentwentyfour team,

I am developing a server which needs to create a folder hierarchy in nextcloud on user demand.

I stumbled into the case where losing the connection to the nextcloud server while executing createFolderHierarchy results in the following uncaught exception:

TypeError: Cannot read property 'statusCode' of null

Since this function does not throw any exception, I end up with my server being killed.

Is there a workaround for this?

@floriansimon1
Copy link
Collaborator

There is no workaround AFAIK. Can you submit a PR to add an exception handler? If not, do you have a consistent reproduction protocol?

@ntma
Copy link
Author

ntma commented Jun 4, 2020

I started diving into the code of this library and found out that the issue comes from the webdav-client library.

It is missing a simple sanity test within the exists(path) (check if a path exists) method as I reported in their repository. Since the exception occurs within a callback, promisify isn't able to catch/throw that exception.. at least AFAIK.

In my opinion, this can only be solved in their side.

@floriansimon1
Copy link
Collaborator

floriansimon1 commented Jun 4, 2020

I think the library is unmaintained. Every time this happened to me, I submitted pull requests, and the author was kind enough to get my PRs merged.

@kwisatz
Copy link
Member

kwisatz commented Jun 4, 2020

There's another reason for us to either fork or ditch and replace WebDAV-Client: it still uses request which has been deprecated a while ago and isn't maintained anymore.

@floriansimon1
Copy link
Collaborator

Not sure about how the landscape has changed, but back when I started to write that library, there was no working alternative to Webdav-client and I didn't feel like rewriting one.

That said, a move might be a good way of finally getting rid of the speed problems we currently face.

@kwisatz
Copy link
Member

kwisatz commented Jun 4, 2020

@floriansimon1 We've been evaluating alternative libraries or simply rewriting the necessary HTTP/WebDAV requests ourselves as we became aware of the deprecation of request.

This is slightly off-topic though, so I don't want to go into too much detail, but yeah, submitting a PR to WebDAV-Client would probably be the quickest way to solve this issue.

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

No branches or pull requests

3 participants