Box has an interesting set of bugs that keep rclone cleanup from working (as well as keeping their own web interface from working) if you have a lot in your trash and, in particular, if a lot of the items are in folders owned by someone else but deleted by you.
First, just doing the normal fetch with limit and offset fails, by just sitting there forever with no server-side response. (Their web interface will eventually throw an error, rclone just sits there forever)
The workaround for this is to replace the limit and offset with ?usemarker=true and then the API will return the first page of results.
The second problem is the API will return items that the current account has deleted but that are owned by another account and these items cannot be removed from the trash by the current account. Using the Box API, it is possible to include the owner in the fields being returned and then skip over them or rclone could just attempt to delete them and play through the error and go onto the next row. Unfortunately, there doesn't seem to be any way to sort or filter what is returned so, in order for rclone cleanup to get past this it would have to...
Fetch the trash with ?usemarker=true
Attempt to delete each item returned in that first fetch but continue if the delete fails
At the end of the page, use the marker value to fetch the next page, (instead of offset)
2021/08/13 11:40:45 DEBUG : rclone: Version "v1.56.0-beta.5482.732bc08ce" starting with parameters ["/home/bcxxxxer/rclone/rclone" "-vvv" "--dump" "headers,requests,responses" "cleanup" "joelbox:"]
2021/08/13 11:40:45 DEBUG : Creating backend with remote "joelbox:"
2021/08/13 11:40:45 DEBUG : Using config file from "/hxxxxnf"
2021/08/13 11:41:16 DEBUG : HTTP REQUEST (req 0xc00021ae00)
2021/08/13 11:41:16 DEBUG : GET /2.0/folders/trash/items?fields=type&fields=id&limit=1000&offset=0 HTTP/1.1
Yes. What rclone does currently SHOULD work and will work in the simplest cases (small number of files in trach all deleted from folders actually located in the client's box account). When there are a large number of files and/or they are deleted from shared folders, Box's own web site fails and so does rclone.
With the workaround to use the markers, both box's web site and the API will at least see the files located in trash. But even Box's "empty trash" button doesn't work and files from shared folders cannot be deleted.
So, it seems that the Rclone Box backend would need two workarounds if we want cleanup to save the day.