Forum BigDB Modifying DatabaseObjects via Player.IO website bug

Discussion and help relating to the PlayerIO database solution, BigDB.

Modifying DatabaseObjects via Player.IO website bug

Postby markloika » September 25th, 2010, 3:51 am

Hey,

I have a table called URL and it has a single property called e, which stands for enabled. The key of the object is the first 40 characters of the url of the game swf. The game loads or creates this object each time it is played, the point of this is to be able to disable the game on certain websites as needed after it's released by manually changing the e property via the Player.IO website. For some reason I am unable to change the value of the e property, or delete an object from this table via the Player.IO website. I've even deleted the entire table and created it again, and I still cannot edit or delete any objects in it.

On another note, when I first started trying to get this to work I didn't truncate the url of the swf, so it was trying to make the key of the object the entire url. Doing that resulted in:

Webservice returned unhandled error: InternalError
An unexpected error occured inside the Player.IO webservice. Please try again.


After seeing that a few times I remembered reading somewhere that the key can't be more than a certain length. Unfortunately I can't find where I read that so I'm not sure what the length is, but I'm pretty sure it's either 40 or 50 characters. It would have been nice to know why I was receiving that error, perhaps that is something that you guys will change, I think it would be helpful to other developers.

Is there a better way to achieve the functionality that I'm looking for? Ideally I wouldn't need to truncate the URL.

Thanks and best regards,
Mark
markloika
 
Posts: 76
Joined: July 8th, 2010, 3:46 am

Re: Modifying DatabaseObjects via Player.IO website bug

Postby Oliver » September 27th, 2010, 11:35 am

Hey Mark,

Thanks for the well written report.

I see two issues on our end (going in the bug module, to be fixed as fast a possible):

a) Can't change the e property

b) Webservice not giving a good error message when passing a bad object key

With regards to the length of urls: The key length limitation on our end is fixed, but you'll probably get really good results if you just MD5 or SHA1 hash the url and use the hash as the database object key.

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Modifying DatabaseObjects via Player.IO website bug

Postby Oliver » September 27th, 2010, 3:39 pm

Hey Mark,

Here is an update:

b) The only reason you can't edit the objects in the web interface is because they have invalid keys (for instance, they contain slashes "/"), which is not allowed in database object keys. If you use firebug or similar, you can actually see the save request failing in the request log because the key does not work in a URL.

So, how come you were even allowed to create the objects with invalid keys? Because the webservice did not correctly check the key before creating the object, which brings us to point B:

b) you should get a proper error message from the webservice now when using invalid keys.

I can't believe there was no unit test for this case!

Again, thanks for reporting this to us!

You should have no problem if you just SHA1 (or MD5) the url and use that as the key of the URL object.


Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Modifying DatabaseObjects via Player.IO website bug

Postby markloika » October 1st, 2010, 8:32 am

Thanks for your help Oliver. Your MD5 idea worked great, and I added a url property, and made it indexed so it's quick and easy to paste a url in the search box and then retrieve the corresponding object. I didn't realize how indexes worked before - they're quite handy!

Mark

P.S. I'm shooting to put the game up for sale on FGL this weekend!
markloika
 
Posts: 76
Joined: July 8th, 2010, 3:46 am

Re: Modifying DatabaseObjects via Player.IO website bug

Postby Oliver » October 1st, 2010, 1:27 pm

Hey,

Cool. PM me a link to the game on FGL :-)

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am


Return to BigDB



cron