MarketplaceService:PlayerOwnsAsset(player, itemId) will incorrectly return false even if the player owns the itemId if the caller is being 429 rate limited on calls to MarketplaceService:getProductInfo(). While a 429 error is visually printed in output, it cannot be caught through a pcall as recommended in the reference documentation (the pcall always succeeds). Thus, there is no way for the developer to know that they should retry the request or whether the result is legitimate.
Repro (run in studio command line) in play mode:
local anItemThatIOwn = 10046007575
local player = game.Players:GetPlayers()[1]
local MarketplaceService = game:GetService("MarketplaceService")
print(MarketplaceService:PlayerOwnsAsset(player, anItemThatIOwn)) -- true
while true do
local success, message = pcall(function()
MarketplaceService:GetProductInfo(anItemThatIOwn)
end)
if not success and string.find(message, "429") then
print("Got 429 rate limited on calls to MarketplaceService:GetProductInfo()")
break
else
print("Successful request. Did not get rate limited.")
end
end
local playerOwnsAssetCheck
success, message = pcall(function()
playerOwnsAssetCheck = MarketplaceService:PlayerOwnsAsset(player, anItemThatIOwn)
end)
print(success, playerOwnsAssetCheck) -- true, false
Output:
A private message is associated with this bug report