chore: simplify conversion of missionReward from PE+ #1018
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "reward-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I would like to keep the current way as a sanity check.
Or at least warn about the case and throw or something.
If for some reason, the data should contain non store items, then the client will bug out receiving them as missionrewards.
So, the additional check doesn't harm and makes sure the items conform with the client's expected format.
The additional check does harm because
/StoreItems/
may be a substring of a non-StoreItem. Also if we assume the data is inaccurate, then we have a lot of other problems.Why would /StoreItems/ which is specifically the identifier of a storeitem be part of a non-store item.
AT LEAST we should throw when a non-store item is found
Sure, drop the additional logic, but make sure the case never happens, data will never be perfect.
Example:
/Lotus/Types/StoreItems/AvatarImages/ImageGaussVED
:)I'd say the data is as close to perfect as it gets, it's just a matter of respecting the 'types'.
But that's a store item.
I'm confused.
And in that case just the store item version would be returned, because it contains store item.
What am I missing, am I too tired?
That's not a store item. The store item for it is
/Lotus/StoreItems/Types/StoreItems/AvatarImages/ImageGaussVED
.well, it contains /storeitems/ so its a store item? :D
Why is it not a store item?
That's exactly what I'm saying is wrong with the logic.
Seems like this item does not have a non-store item counterpart. For some reason
Bro.
/Lotus/Types/StoreItems/AvatarImages/ImageGaussVED
/Lotus/StoreItems/Types/StoreItems/AvatarImages/ImageGaussVED
Ah so im too tired
I think its a mistake in their data. oof
Yes, DE is wrong, it's surely not our code that's making stupid assumption.
well, okey. if the data are bad, we are doomed to find more of these annoying bugs anyway.
KK. remove the logic.
you can't tell me you don't think that's a typing mistake.
the client's data have shown REPEATEDLY in the past how many syntax errors there are in the package, double properties, spelling mistakes in [Lotus/...] like ,Lotus/
Also, there are barely any cases like this, is it the only one?
I am 100% sure someone made an error there.
It's not a mistake on DE's part, and it's not the only instance of this.
If anything, this example shows, that we cannot just remove /storeItems/ and think its the normal non-store variant.
It shows we ALWAYS have to look up typeName.
It's fine, string.replace in JavaScript only replaces the first occurence so this generally works for us, and we have no correctness problems.