Cannot pass "service-type" argument to getAccounts()

Bug #1316969 reported by Alberto Mardegan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unity-webapps-qml
New
Undecided
Unassigned

Bug Description

While improving lp:ubuntu-sdk-tutorials to use a specific service to authenticate, I bumped into this error when launching the html5-example-online-accounts-facebook-albums example:

=========
WebApps API message received: {"target":"ubuntu-webapps-binding-call","name":"OnlineAccounts.getAccounts","args":"[{\"provider\":\"facebook\",\"service-type\":\"oa-2\"}]","callback":{"callbackid":"ubuntu-webapps-api0.5118796625174582"}}
Error while creating object: Ubuntu.OnlineAccounts.AccountServiceModel : [{"lineNumber":1,"columnNumber":85,"fileName":"file:///usr/lib/x86_64-linux-gnu/qt5/qml/Ubuntu/UnityWebApps/inline","message":"Expected token `:'"},{"lineNumber":1,"columnNumber":90,"fileName":"file:///usr/lib/x86_64-linux-gnu/qt5/qml/Ubuntu/UnityWebApps/inline","message":"Expected token `,'"}]
=========

When I modify the code to use "service" instead of "service-type", it works:

=========
WebApps API message received: {"target":"ubuntu-webapps-binding-call","name":"OnlineAccounts.getAccounts","args":"[{\"provider\":\"facebook\",\"service\":\"com.ubuntu.developer.knitzsche.oa-2_oa-2\"}]","callback":{"callbackid":"ubuntu-webapps-api0.0970717747695744"}}
account-service-model.cpp 286 update
account-service.cpp 100 setObjectHandle Accounts::AccountService(0x2bd6660)
{"accountId":132,"displayName":"mardyXXX","enabled":true,"provider":{"displayName":"Facebook","iconName":"facebook","id":"facebook"},"service":{"displayName":"Facebook","iconName":"facebook","id":"com.ubuntu.developer.knitzsche.oa-2_oa-2"},"serviceEnabled":true}
=========

The data passed to the filters should be completely transparent for unity-webapps-qml, but it appears that it's actually doing something with it. I wonder, maybe it's trying to parse the expression and fails because of the "-" sign in "service-type"?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.