I figured out what's causing the bug when you can't repurchase hero relics after deleting them!
Hi guys, I will go in-depth explaining the issue and how I (we @anagarcia33) found the solution for it in this post, if you don't like to read it there is a TL;DR at the end of the post <3 Much love.
With the introduction of new armory and profiles, there was a period of a couple of months where you could delete hero relics from the armory. My curiosity struck and I deleted a couple of them but when I tried repurchasing them, for some reason I was only being able to buy 1 - for every other deleted relic the relic roulette was spinning but at the end I was getting the "Internal server error- please try again later". This issue has been ongoing for maybe a year, and in that period I've made acquaintances with more than 10-15 people having the issue and regularly posting on the git-hub tracker.
Recently we made a discord server sharing our experiences. What was in common was (or so I thought till last night) that for some reason everybody was only being able to purchase one relic after deleting them, which to me was weird, because why only one, why that specific relic and not the others right? Well, last night a breakthrough appeared: @anagarcia33 said she remembered having only two hero relics deleted on a certain hero, so normally we asked her to try purchasing the rest of them..... AND IT WORKED. She was able to purchase every single relic for the hero, except one without any problems.
Since I'm a software engineer, it struck me.... Hero relics are stored in a data structure called 'array'. When initializing, probably the capacity was set to 14( each hero has 14 hero relics), but the fun part is when you set the capacity of a given array to 14, that means the array has 15 fields ( position 0 is considered a field too). When a relic is being deleted, instead of it being removed from the array, it's value is simply being put to 'null'. That way the relic is no longer shown, but the 'null' value still takes a field in the array, which explains why everybody with the exception of @anagarcia33 was being able to re-purchase only 1 relic (there is 1 free space in the array) and she was able to buy 13.
As I said, all of us have had this issue for almost a year, we've made github posts regularly, each getting upvotes in the range of 10-25 upvotes, we've contacted steam support saying they will forward the issue - still nothing. Help us track our stats once again, with this post providing the problem and the solution for it, it will take you guys maximum 2 minutes of your time.
I appreciate the time you took reading this.
TL;DR: Hero relics are stored in an array with capacity of 14(15), but when a hero relic is deleted its value is set to null instead of it being removed from the array, which causes a "Internal server message error" when trying to repurchase the relic since it has no storage left for it.
:*
r u sure saved in array of 14? how to explain why i still have 16 (2 hidden) saved then? i dont think the capacity is limited to 14/15
not sure if i understand properly, so you deleted all on a hero, then can only rebuy 1 random before error message repeats?
is this random relic or always the first one?
and someone only deleted 2, but able to rebuy everything back except 1 of the 2 deleted ones? always the same / first one or maybe random again?
my guess is there is no limit to player database. can store as many new or old relics as they want, but there is an index out of bound / wrong pointer when trying to randomise purchase or search check whether you owned the deleted relics. e.g. if it gets same number / null for the one you already owned but deleted, it will cancel purchase and pop error message to prevent buying duplicates? Otherwise shouldnt ana can only buy 12 out of 14 if there are 2 nulls? but maybe it start over as 1-14 not 0-13 so it will always miss the last one because it can only get 1-13 random numbers
r u sure saved in array of 14? how to explain why i still have 16 (2 hidden) saved then? i dont think the capacity is limited to 14/15
not sure if i understand properly, so you deleted all on a hero, then can only rebuy 1 random before error message repeats? is this random relic or always the first one?
and someone only deleted 2, but able to rebuy everything back except 1 of the 2 deleted ones? always the same / first one or maybe random again?
my guess is there is no limit to player database. can store as many new or old relics as they want, but there is an index out of bound / wrong pointer when trying to randomise purchase or search check whether you owned the deleted relics. e.g. if it gets same number / null for the one you already owned but deleted, it will cancel purchase and pop error message to prevent buying duplicates? Otherwise shouldnt ana can only buy 12 out of 14 if there are 2 nulls? but maybe it start over as 1-14 not 0-13 so it will always miss the last one because it can only get 1-13 random numbers
It's a random relic, not the first one, also how do you have 15/14 relics? How is that possible? Is it because some of the relics got changed? Also yeah, they had 2 relics, deleted them and then were able to buy 13 relics, again random not the first or the second or w/e - random. Might also be the null pointer exception you're talking about, but why on earth was I allowed to buy this random relic? Or as in @anagarcia33 case 13 of them?
yeah some of the relics changed so i hv 16. if you were able to buy only 1 and garcia 13 im guessing maybe -1 or + 1 in formula or it reads the previous value in error instead of the updated number? e.g. if you have 1 relics -1 to current relics but random outcomes 1-14 should also +1? so if you had 0 relics the range 1-14 +1 = 1-15 becomes error? then always miss the last one if the first one start with 0-13 but has +1 in delete formula?
and maybe if the code is something like if x random outcomes < 14 do something, you suddenly become x = 15 so cannot buy anymore after buying 1, while your friend didn't sell every relics but if has 1 it will never be 0 so always miss last one. you girls probably know more as programmer im just a noob aha anyway if you close the issue is it fixed with the new update?
not sure if i understand properly, so you deleted all on a hero, then can only rebuy 1 random before error message repeats? is this random relic or always the first one?