After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 744988 - Loading scores does not work
Loading scores does not work
Status: RESOLVED FIXED
Product: libgnome-games-support
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libgames-scores maintainer(s)
libgames-scores maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-02-23 00:33 UTC by Michael Catanzaro
Modified: 2015-02-23 15:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (2.83 KB, patch)
2015-02-23 14:45 UTC, Nikhar
none Details | Review
scores: Rename Context.request_category() to Context.category_request() (1.82 KB, patch)
2015-02-23 15:17 UTC, Michael Catanzaro
none Details | Review
scores: warn if the game does not connect to Context.request_category() (1.24 KB, patch)
2015-02-23 15:17 UTC, Michael Catanzaro
none Details | Review
Scores are now loading again. (2.83 KB, patch)
2015-02-23 15:17 UTC, Michael Catanzaro
none Details | Review

Description Michael Catanzaro 2015-02-23 00:33:07 UTC
The library never loads scores, or at least they never make it as far as the scores dialog. Not sure when this broke.
Comment 1 Nikhar 2015-02-23 14:07:58 UTC
Did a binary search through the log. Seems the following commit broke it. Looking into it right now.

commit ff1e4cfe4f7590cc3de0217cb51cadb43d657ef2
Author: Michael Catanzaro <mcatanzaro@gnome.org>
Date:   Sun Feb 22 13:27:36 2015 -0600

    scores: load scores from file when creating the Context
Comment 2 Michael Catanzaro 2015-02-23 14:43:55 UTC
Hm, that was an attempt to fix this bug. :)
Comment 3 Nikhar 2015-02-23 14:45:11 UTC
Created attachment 297650 [details] [review]
Patch

I think I've figured out the issue. It's similar to the problem we were facing when we were trying to implement signals for the first time.

'load_scores_from_files' requires the signal 'request_category' to be bound to a method. The signal can only be bound to a method in the game source after Context object has been created. Calling 'load_scores_from_files' in context means that there is no method to which 'request_category' is bound. This means that after the line

var category = request_category (category_key);

category would always be null.


Here's a patch attached that basically just undoes the commit mentioned in the previous comment. I don't see any other fix for this at the moment. But I might be wrong.
Comment 4 Michael Catanzaro 2015-02-23 14:56:22 UTC
Oh OK, good job. I bet I wasn't able to load scores because GNOME 2048 probably does not connect to that signal. So besides reverting my change, we should also make this harder to abuse....
Comment 5 Nikhar 2015-02-23 15:00:08 UTC
Connecting to the signal is probably necessary because of the whole category name, key and translation issues that we'd discussed at length earlier. One thing that we can do is if no method's attached, keep the name the same as key which would be the same as the file name in which the score's stored.

PS: Is it ok if we continue this chat here? I really feel like I'm spamming everyone cc'ed to this :P
Comment 6 Michael Catanzaro 2015-02-23 15:17:02 UTC
I push this with some trepidation, because reverting my commit breaks usage of the Context.has_scores() function I added yesterday for games to use to decide whether the scores dialog should be accessible or not. I will file another bug for that.

The following fixes have been pushed:
ff5f3d4 scores: Rename Context.request_category() to Context.category_request()
9850d1e scores: warn if the game does not connect to Context.request_category()
22b345c Scores are now loading again.
Comment 7 Michael Catanzaro 2015-02-23 15:17:06 UTC
Created attachment 297672 [details] [review]
scores: Rename Context.request_category() to Context.category_request()
Comment 8 Michael Catanzaro 2015-02-23 15:17:09 UTC
Created attachment 297673 [details] [review]
scores: warn if the game does not connect to Context.request_category()
Comment 9 Michael Catanzaro 2015-02-23 15:17:12 UTC
Created attachment 297674 [details] [review]
Scores are now loading again.

Basically undid one of the previous commits.