box/box-android-apptoapp-sdk

Box.getAccountTree returns null / "unknown http status"

Opened this issue · 1 comments

After the first call to Box.getAccountTree, subsequent calls result in the onComplete handler being called with a null BoxFolder, and the status "unknown http status" (or whatever the appropriate constant actually contains).

This behaviour is not documented anywhere noticable

The behaviour is a result of the HttpUrlConnection in BoxSynchronous.saxRequest having 'useCaches' turned on, which causes conn.getResponseCode() to return -1.
Adding conn.setUseCaches(false); to this method before conn.connect(); results in the http request always getting executing, and a BoxFolder always being passed to onComplete.

Very interesting, thanks for the report. We've never had this reported to us, nor have we seen this in our own use of the library, but we'll definitely look into it further. In any case, setting setUseCaches(false) is unlikely to be harmful so we can likely just add it after we've tested. A couple quick questions though:

  1. Why would useCaches cause a -1 responseCode? Any documentation/reports you can point to? How did you figure this out?
  2. Is there a specific device that you saw this on? As mentioned, we haven't ran into this so I'd be curious to know if it's a device/rom specific issue.

Thanks again.