← Back to team overview

mugle-dev team mailing list archive

Re: Delete UserGameProfile

 

--REPLY ALL--

It may be a problem with the key lookup - check the UserGameProfileGetter -
when the UGP isnt found, it tries to create a new one and return it, so
there may be a problem with the logic there.

Removing the UGPs shouldnt be too hard - the remove function just needs to
call the appropriate removePair calls in the KVP, UserAchievement, and User
ServiceImpl classes (which will remove the key relationships between them)
then delete itself.
The problem then is you will need to make it so both the KVPserviceImpl and
UserAchievement appropriate removePair methods also remove themselves when
called.

ie:

UserGameProfileServiceImpl.
remove(UserGameProfile ugp) {
   // check Permissions
   // ugpdata = lookup UGP from datastore
   for (Key k : ugpdata.getKeyValuePairs()) {
       get KVP from datastore
       // youll either need to cast it to a client object, create a new
overloaded method:
       KeyValuePairServiceImpl.removeUserGameProfile(kvp, ugp);
   }
   // Do the same for UserAchievement and User

   // un-persist ugp from the datastore (already implemented)
}


KeyValuePairServiceImpl.removeUserGameProfile(KeyValuePair kvp,
UserGameProfile ugp) {
    //existing stuff
    // removes relationships
    KeyValuePairServiceImpl.remove(kvp);
    // other stuff
}

Do the same in UserAchievement.removeUserGameProfile()


On Thu, May 26, 2011 at 9:41 PM, Matt Giuca <matt.giuca@xxxxxxxxx> wrote:

> Scott, you have been looking at deleting data.
>
> I'm wondering how hard it will be to delete UGPs (without worrying about
> deleting other kinds of data).
> https://bugs.launchpad.net/mugle/+bug/788541
>
> I'm trying to track down a production bug which seems to only happen the
> first time for any given UGP, so it would be good to be able to delete them
> on production to test.
>
> I think all we have to do is:
>
>    - Delete all KeyValuePairs and AchievementData associated with the UGP.
>    - Remove the UGP from the ugps field of the user and game,
>    respectively.
>    - Delete the UGP itself.
>
> That doesn't sound too hard, and would help us get an idea about how hard
> it is to delete data in general. Do you think we could do that tonight?
>
> Another thing: I am looking at the production data. Do you have any idea
> why there would be so many UGPs with null for every single field, including
> the user? It seems like for every 1 legitimate UGP there are about 10
> completely blank ones. There are hundreds and hundreds of UGPs already.
>
> --
> Mailing list: https://launchpad.net/~mugle-dev
> Post to     : mugle-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~mugle-dev
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References