Bug 391111 - Rating doesn't work; all GHNS dialogs always display "Unknown Open Collaboration Service API error
Summary: Rating doesn't work; all GHNS dialogs always display "Unknown Open Collaborat...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-knewstuff
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.56.0
Platform: Other Linux
: VHI normal
Target Milestone: ---
Assignee: Jeremy Whiting
URL:
Keywords:
: 388825 397513 403610 405584 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-02-26 16:44 UTC by Harald Sitter
Modified: 2019-03-18 15:57 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.57


Attachments
screenshot (153.44 KB, image/png)
2018-02-26 16:46 UTC, Harald Sitter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2018-02-26 16:44:07 UTC
in any download dialog. try to rate from the detailsentry page: error 'Unknown Open Collaboration Service API error. (999)

Output on terminal (with all qdebug categories enabled)

konsole(32736)/(org.kde.knewstuff.core) KNSCore::AtticaProvider::detailsLoaded: check update finished:  "One Dark Konsole"
konsole(32736)/(org.kde.knewstuff) KNS3::EntryDetails::ratingChanged: rating:  10  ->  100
konsole(32736)/(default) unknown: content-type missing in HTTP POST, defaulting to application/x-www-form-urlencoded. Use QNetworkRequest::setHeader() to fix this problem.
konsole(32736)/(org.kde.knewstuff.core) KNSCore::AtticaProvider::jobSuccess: job error:  2  status code:  999 "unknown request"

By manually adding some qdebug in attica I eventually got to the actual request being sent to the server 

konsole(11421)/(default) Attica::Provider::createRequest: () QUrl("https://api.kde-look.org/ocs/v1/content/vote/1216368")

(that is null headers and that url). And indeed when trying to post to that url I get the code 999 back. Same with a GET request FWIW. So this might be a server side issue after all.

➜ curl -X POST https://api.kde-look.org/ocs/v1/content/vote/1216368
<?xml version="1.0" encoding="UTF-8"?>
<ocs><meta><status>failed</status><statuscode>999</statuscode><message>unknown request</message></meta></ocs>
Comment 1 Harald Sitter 2018-02-26 16:46:54 UTC
Created attachment 111021 [details]
screenshot
Comment 2 starbuck 2018-03-09 10:45:19 UTC
since the switch 2016, push-calls like e.g. ratings or uploads via ghns are no longer supported to prevent easy mis-usage.

The whole social desktop part in general has been reduced, as it doesn't seem to have been actively developed upon in the past 4-5 years since the switch to Plasma 5.
Comment 3 Dan Leinir Turthra Jensen 2018-03-09 10:58:40 UTC
Ah, right. So, two levels of problems here:
1) We get this error when trying to /fetch/ the data as well, not just push it (i'd suggest that's still an error)
2) We get the error when attempting to vote

For 1, what we need, i guess, is a way to handle it just a touch more gracefully than spitting out a bunch of 999 errors... Perhaps a 405 Method Not Allowed response would be more useful for this? Perhaps even for both. With that, we'd be able to then sniff that in kns and adjust the UI accordingly.
Comment 4 starbuck 2018-03-09 14:39:28 UTC
"For 1, what we need, i guess, is a way to handle it just a touch more gracefully than spitting out a bunch of 999 errors... Perhaps a 405 Method Not Allowed response would be more useful for this?"

I can't see where this happens when you fetch the voting?

Maybe you mean for 2 "pushing a vote" you would need a 405 response?
Comment 5 fire f. 2018-06-11 17:18:41 UTC
maybe its easier to list working features of KNewStuff ( = 1%  ?) rather than listing stuff which is broken, it being about 99% of KNewStuff including 99.9% of documentation.
Comment 6 Christoph Feck 2018-06-11 20:21:35 UTC
If you find outdated documentation, please update it. It looks like you can write proper english.
Comment 7 fire f. 2018-06-11 21:15:12 UTC
Yes, I did that outside of KDE already, where the reach - of course - is inadequate.
Comment 8 Nate Graham 2019-01-25 23:45:28 UTC
*** Bug 397513 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2019-01-25 23:45:30 UTC
*** Bug 403610 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2019-01-26 00:13:51 UTC
*** Bug 388825 has been marked as a duplicate of this bug. ***
Comment 11 Ronald 2019-02-01 13:47:05 UTC
(In reply to starbuck from comment #4)
> "For 1, what we need, i guess, is a way to handle it just a touch more
> gracefully than spitting out a bunch of 999 errors... Perhaps a 405 Method
> Not Allowed response would be more useful for this?"
> 
> I can't see where this happens when you fetch the voting?
> 
> Maybe you mean for 2 "pushing a vote" you would need a 405 response?

The OCS API now provides the status code 405 and the message: "method not allowed".

We're just wondering that when loading a product list for each project, a POST is invoked on /ocs/v1/content/vote/XXX. Is that on purpose?
Comment 12 Dan Leinir Turthra Jensen 2019-02-01 13:48:34 UTC
(In reply to Ronald from comment #11)
> (In reply to starbuck from comment #4)
> > "For 1, what we need, i guess, is a way to handle it just a touch more
> > gracefully than spitting out a bunch of 999 errors... Perhaps a 405 Method
> > Not Allowed response would be more useful for this?"
> > 
> > I can't see where this happens when you fetch the voting?
> > 
> > Maybe you mean for 2 "pushing a vote" you would need a 405 response?
> 
> The OCS API now provides the status code 405 and the message: "method not
> allowed".

  Great, thank you! We should be able to handle that much more gracefully, then :)

> We're just wondering that when loading a product list for each project, a
> POST is invoked on /ocs/v1/content/vote/XXX. Is that on purpose?

Hm, no, that should be a GET, not a POST. I shall have to look at what's going on with that...
Comment 13 Patrick Silva 2019-03-18 12:00:57 UTC
*** Bug 405584 has been marked as a duplicate of this bug. ***
Comment 14 Dan Leinir Turthra Jensen 2019-03-18 15:42:13 UTC
Git commit 2a40085fc3d2a4a74392eaea31bea82c3b0a465d by Dan Leinir Turthra Jensen.
Committed on 18/03/2019 at 15:40.
Pushed by leinir into branch 'master'.

Handle unsupported OCS commands, and don't over-vote

When the server does not support certain commands (such as voting),
don't be quite so loud about it. It is not a critical error, and we
should accept it when we are told so.

Also, the same bug report covers votes being sent out during listing
of items. This is caused by the rating being set sometime after
setting up a signal chain, and then changing the rating of the
widget. So, block signals when we're simply updating the rating's
internal state.
Differential Revision: https://phabricator.kde.org/D19858

M  +2    -0    src/attica/atticaprovider.cpp
M  +3    -0    src/ui/itemsviewdelegate.cpp
M  +5    -1    src/ui/progressindicator.cpp

https://commits.kde.org/knewstuff/2a40085fc3d2a4a74392eaea31bea82c3b0a465d