nextcloud / integration_onedrive

🗔 Integration of Microsoft OneDrive into Nextcloud
GNU Affero General Public License v3.0
32 stars 7 forks source link

API request error results in end of import #23

Closed scebbers closed 1 year ago

scebbers commented 2 years ago

Following my previously posted issue, my import now ends prematurely, with the following error:

{"reqId":"JpjRxLkfzeDTnfTIbDrV","level":2,"time":"2021-07-25T04:00:04+00:00","remoteAddr":"","user":"--","app":"integration_onedrive","method":"","url":"--","message":"OneDrive API error : Client error: 'GET https://graph.microsoft.com/v1.0/me/drive/root:/Documents/folder/foldername_with_#1:/children?filter=file+ne+null' resulted in a '400 Bad Request' response:\n{\"error\":{\"code\":\"invalidRequest\",\"message\":\"Path (/LiveFolders/Documents/Bunch_of_folders\n","userAgent":"--","version":"21.0.2.1"}

My guess is the filename of the folder to be imported (here named /Documents/folder/foldernamewith#1) is not properly URL encoded (I think the # is causing issues). I've renamed the folder to something without the '#' and restarted importing to see if the problem disappears.

julien-nc commented 2 years ago

Nice catch. I could reproduce the bug and fix it. You were right, encoding the folder name in the request URL was needed.

It's available in latest nightly (v1.1.1-2-nightly). Could you try it?