amtgard / ORK3

Version 3 of the Online Record Keeper
Other
23 stars 12 forks source link

Player merges occasionally failing #97

Closed Tyedye closed 6 years ago

Tyedye commented 8 years ago

I was contacted by the PM of Mistyvale, telling me that http://amtgard.com/ork/orkui/index.php?Route=Player/index/53963 had lost their last 5 years of credits. Their last attendance was 4/16/16. If you look at the attendance for this date, http://amtgard.com/ork/orkui/index.php?Route=Attendance/park/525&AttendanceDate=2016-04-16 there is a space with no name listed. Chris looked in his backup, and was able to find http://amtgard.com/ork/orkui/index.php?Route=Player/index/40288 as a record that was likely merged with it. It looks like number 53963 was a 'westmarch event credit' With this info, it looks like player number 40288, the actual record, was merged with player number 53963. and somehow this failed.

Possibly related, a few days previously the Wetlands PM contacted the admins saying that Ozymandias records had been blanked. He was able to identify where he believed the players records are, http://amtgard.com/ork/orkui/index.php?Route=Player%2Findex%2F32684 and we were able to look up the number and verify this.

He also told me "Of note: I was just alerted by the Stormwall PM that she had a duplicate of her own record appear this week which she merged with her regular record Regular record is "Elora" sudden new record had no info, no persona, only her mundane name "Gina Chambers""

Tyedye commented 8 years ago

I got some info from the WM PM, who merged the first example. He told me: "Not much interesting - I forget exactly when (but considering the credit issue it must have been merging Kalandra's accounts) the ORK gave an server internal error 500; I took a break and when I returned everything was working fine. That was only that one time I got an error message. In terms of anything I did different - nothing special that I recall. Spot checking assorted other merged accounts, nothing appears off. Timewise, about 1:20pm (pacific) thursday."

"That was my intent, to clear out those old ones. I think with Kalandra I went backwards, destroyed the newer one merging toward the event credits one." I am not certain which of these is more the issue, though Glenalth and I can experiment some and see what we can tell, but that would not explain the other issues.

Tyedye commented 8 years ago

I just experienced issues merging a player. I merged http://amtgard.com/ork/orkui/index.php?Route=Player/index/13306 with http://amtgard.com/ork/orkui/index.php?Route=Player/index/50169 I have attached screenshots of what each players records looked like prior to the merging.

Looking at 50169 now, I can see that some of the credits were transferred, but others were not. looking at 13306 I can see that some of the credits were removed from this record, but not all of them. It also removed all of the player name type data from 13306. This is not something I ever would have noticed until I was looking for issues now.

When merging them, 13306 was set to be destroyed.

50169 13306

esdraelon commented 8 years ago

The issue is that the SQL statement that attempted to clean up the attendance table prior to merge is invalid (references the updating table from a where clause).

Referencing the table via a sub-query fixes the issue.

However, player records that did not merge correctly now have "orphaned" attendance records. Re-merging requires creating a dummy mundane record for each set of orphaned attendance records. There is also no way that I can see to determine where those records should go ... just that they should go somewhere.