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

3.001: Expected BEGIN_ARRAY but was Number at line 1 column 19 #256

Closed
BernhardPosselt opened this issue Sep 19, 2014 · 11 comments
Closed
Labels

Comments

@BernhardPosselt
Copy link
Member

Hi David,

I'm trying to access the API on master (news + owncloud) but I'm getting the above mentioned error message. There is no stackstrace and it's kinda hard to debug. Is there some kind of debug mode?

I've made some changes to the controllers but the API should be the same. I'm unsure where the error lies but I think its some kind of JSON parsing problem? I've checked the JSON output and everything is valid and looks according to the spec (I may have missed something though), so maybe you've got some time to do some debugging, meanwhile I'm stranded and cant update my feeds on my android device xD

PS: You need this PR to fix basic auth: owncloud/core#11158

@BernhardPosselt
Copy link
Member Author

I've cleared the cache and deleted the folder in my sdcard directory fyi

@BernhardPosselt
Copy link
Member Author

API should also be testable on 7 btw, the interface will looked a bit fked up though :P

(that is if you reduce the owncloud min version from 7.8 to 7 in appinfo/info.xml)

@David-Development
Copy link
Member

Thank you for the report. I tried to update my ownCloud to 7.0.2 but it sucks and after trying to pull the latest version from the git repo I'm only getting a {"data":{"message":"Token abgelaufen. Bitte lade die Seite neu.","error":"token_expired"},"status":"error"} error message.. So what's the proper way to install oc 8 from git?

I already cloned core, 3party and the news app. And I applied the pr (https://github.com/owncloud/core/pull/11158/commits) but without success..

@BernhardPosselt
Copy link
Member Author

Check the dev docs, there should be a setup guide. Ttyl not home ;)

@David-Development
Copy link
Member

Okay I think I figured out the problem. You changed the field order of the json result. (Feed Response)

Expected:
{
"feeds": [],
"starredCount": 0,
"newestItemId": 0
}

In Version 3.002:

{

"starredCount": 0,
"feeds": [],
"newestItemId": 0
}

@BernhardPosselt
Copy link
Member Author

I see, thanks :)

Can you fix this? It shouldn't depend on the order but access it by key, otherwise it's very likely to break again in the future

@David-Development
Copy link
Member

I can try to fix this issue but it's not that easy. Yes of course it should access the values based on the key but I'm using a special mechanism to read the json result (read directly from the input stream) and so it's not that easy like json.getJsonArr("feeds");

@David-Development
Copy link
Member

Fixed ;)

@BernhardPosselt
Copy link
Member Author

How did you fix it :)? I think its better to read it reliably than fast, the biggest issue with speed is the API and the amount of requests anyways, so this needs to be optimized :)

@David-Development
Copy link
Member

Sure but the problem is that the result may be so big, that the available memory of the device is not enough (OutofMemoryException - already got this issue on older devices with the default android json reader which parses the whole result first).

@BernhardPosselt
Copy link
Member Author

wow damn :) I see its a memory issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants