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

WebDAVFileProvider#writeContents not reconnecting with credentials after 401 #148

Open
tladesignz opened this issue Mar 19, 2019 · 2 comments

Comments

@tladesignz
Copy link

I tried the latest master (9384264) to get rid of the Swift version warnings.

Unfortunately, a regression was introduced: As far as I can understand from my Nextcloud server logs, WebDAVProvider#writeContents doesn't reconnect on HTTP 401 (Unauthorized) with credentials anymore.

This works with last release 0.25.1.

@tladesignz
Copy link
Author

Ok. Today's Xcode update with Swift 5 forced me to use the latest fork I could find.

I tried to work around this by writing a temp file and using #copyItem(localFile:to:completionHandler:). This still breaks. So it must be the content, which is JSON.
Somehow this breaks the upload. Sometimes without any error message (just hanging) or with -999:

Task <7F91F278-D7B1-4C00-9A88-22D6BAEF018D>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://nextcloud.example.com/remote.php/webdav/Test/2019-03-26T15%3A13%3A43GMT+01%3A00/IMG_0005.JPG.meta.json, NSErrorFailingURLKey=https://nextcloud.example.com/remote.php/webdav/Test/2019-03-26T15%3A13%3A43GMT+01%3A00/IMG_0005.JPG.meta.json, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalUploadTask <7F91F278-D7B1-4C00-9A88-22D6BAEF018D>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask <7F91F278-D7B1-4C00-9A88-22D6BAEF018D>.<1>, NSLocalizedDescription=cancelled} [-999]
2019-03-26 15:14:19.525753+0100 OpenArchive[9762:148233] Task <7F91F278-D7B1-4C00-9A88-22D6BAEF018D>.<1> finished with error - code: -999
2019-03-26 15:14:19.526516+0100 OpenArchive[9762:148232] Task <7F91F278-D7B1-4C00-9A88-22D6BAEF018D>.<1> HTTP load failed (error code: -999 [1:89])

The next upload, which is an image file, works without problems. As mentioned, the last release works just fine with the JSON content.

What did change?

tladesignz added a commit to OpenArchive/Save-app-ios that referenced this issue Mar 26, 2019
This way, we can leverage app-independent background uploading and it was hoped to fix a bug with the FilesProvider library.

Unfortunately it didn't, so metadata upload was disabled for now. See amosavian/FileProvider#148
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

2 participants
@tladesignz and others