GameVersion version number should be an int

Bug #722966 reported by Matt Giuca
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MUGLE
Fix Released
High
Prageeth Silva

Bug Description

Currently, the GameVersion class's primary key pKey is a String, which is emulating a composite key built from the Game ID (int) and version number (string). This is a bit messy, but we have decided to keep this weird string composite key.

The bug is this: The "version number" part of the string is itself an arbitrary string. It should be an int. Thus, pKey is a string comprising two ints separated by a slash.

GameVersion's version parameter should have type int. getVersion should return an int.

The reason it was a string was to support version numbers such as "1.4.2". That is not the purpose of a primary key -- they should be sequential integers which developers have no control over (they simply increment each version). Outside the scope of this bug: add another field "version_string" which is a developer-customisable version number string, for display purposes only.

Related branches

Changed in mugle:
status: Triaged → Fix Committed
Revision history for this message
Matt Giuca (mgiuca) wrote :

The GameVersion class now has a separate 'Integer version' field (which is persistent). This redundantly stores the version number (so a class might have pkey "42/12" and version 12). I thought we had agreed we would simply parse the integer out of the string, so it is not redundantly stored.

I'll change it so there is no explicit field 'version', and instead the getVersion method pulls the version number out of the string. Does anybody object to this change?

David Coles (dcoles)
Changed in mugle:
milestone: none → 0.1.1
Revision history for this message
Matt Giuca (mgiuca) wrote :

Assigning back to me, to make the above mentioned change.

Changed in mugle:
assignee: nobody → Matt Giuca (mgiuca)
status: Fix Committed → In Progress
Revision history for this message
Matt Giuca (mgiuca) wrote :

Fixed in trunk r66.

Changed in mugle:
status: In Progress → Fix Committed
Revision history for this message
Prageeth Silva (prageethsilva) wrote :

Oh I didn't see this mentioned comment. We have two problems with this:

a) This means the field cannot be made null when converting to the Client Model Class, but that's given we use a field. However, if the string is null, trying to get the version will given an exception. The client needs to check if the value is null, and in order to do that, the getVersion method would try to extract the value.

b) Didn't we come to the conclusion that extraction is possible only given that the data it holds is in the correct format? True, we can make sure it's stored properly, but IN CASE there is something wrong with the string, we may get an exception.

Please let me know what I should do before I can merge the data-wrapper.

Thanks!

Revision history for this message
Matt Giuca (mgiuca) wrote :

Re-opening this bug since apparently the fix is not acceptable. (I can't look at it now, but just making sure we don't forget.)

Changed in mugle:
importance: Medium → High
status: Fix Committed → Triaged
Changed in mugle:
assignee: Matt Giuca (mgiuca) → Prageeth Silva (prageethsilva)
Revision history for this message
Prageeth Silva (prageethsilva) wrote :

This will be completly implemented by Tuesday (5/04/2011). There will also be a client service that lets users upload and download files.

Revision history for this message
Prageeth Silva (prageethsilva) wrote :

Please disregard the previous comment, it was meant to be for another bug. But for some reason it has been added to this. However, this too will be completed by the deadline (5/04/2011).

Revision history for this message
Matt Giuca (mgiuca) wrote :

This seems to be fixed now. Please let me know if it isn't.

Changed in mugle:
status: Triaged → Fix Committed
Matt Giuca (mgiuca)
Changed in mugle:
status: Fix Committed → Fix Released
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.