Describe the bug
When PUTting a bookmark via the API and altering the "folders" key, it will only add the new value to the "folders" array instead of overwriting the existing array. So moving a bookmark between folders or removing it from a folder is currently not possible via the API.
To Reproduce
Steps to reproduce the behavior:
PUT https://your.next.cloud/index.php/apps/bookmarks/public/rest/v2/bookmark/1337 with body:{
"url": "http://bookmark.url",
"title": "bookmark.title",
"description": "bookmark.description",
"tags": ["tag", "asdf"],
"folders": [666]
}
..."folders": [555, 666]...Expected behavior
200, ..."folders": [666]...
Desktop (please complete the following information):
Server (please complete the following information):
Nextcloud log (nextcloud/data/nextcloud.log)
No Error logged
Thanks for reporting these! Apparently, my floccus tests also caught this one, but I failed to notice it :see_no_evil:
btw, out of curiosity, what kind of client are you working on? :)
I'm working on an iOS client (Nextbookmark). Mostly because I just wanted to easily upload URLs to Bookmarks but it somehow found an audience and therefore I'm slowly working my way through your API :)
Have you published it on the appstore as well?
yes
Shall we link to it in the README here?
Sounds good. Here you go
mmmh, for some reason my floccus CI tests fail, while everything passes locally :thinking:
Can you try running your app against latest master?
Created a local dev environment based on the Nextcloud "stable19" branch, your master branch, a sqlite db and ran the requests against that env: The odd behaviour is gone 馃憤
And just to be sure that is is not dependend on running with a local, non-productive webserver or sqlite db... I deleted the app, installed it in the same enviroment from the app store (v3.2.4) and ran the tests again: Odd behaviour is back again :)
Oof, I've finally sorted out my CI issues and can do a realease in confidence now. :sweat_smile: