Hello,
Was asked in the Discord to make an issue for this. So here goes. I'm having an issue when calling EquipItem to replace an Item I want to transfer out returns a 1:"Success", but subsequent calls to TransferItem return 1656:"You cannot perform this action on an equipped item."
Background:
Goal: Given a List of 8 items (one for each weapon/armor) and 1 characterId,
Process I am using:
GetItem(300,307)
create lists of items based on state:
Every case except for 3 works just fine.
My code for handling the list of case 3:
for char in equippedelsewhere:
for item in equippedelsewhere[char]:
carrieditems = getCharacter(session, membershiptype, membershipid, char, COMPONENTS['CharacterInventories'])
a = carrieditems['inventory']['data']['items'][0]
equipItem(session, a['itemInstanceId'], char, membershiptype)
transferItem(session, membershiptype, char, item['itemHash'], item['itemInstanceId'], 1, True)
transferItem(session, membershiptype, target, item['itemHash'], item['itemInstanceId'], 1, False)
Data from Testing:
Item a:
{'itemHash': 1839565992, 'itemInstanceId': '6917529080947774514', 'quantity': 1, 'bindStatus': 0, 'location': 1, 'bucketHash': 1498876634, 'transferStatus': 0, 'lockable': True, 'state': 0, 'dismantlePermission': 2}
Resposne from EquipItem:
'{"Response":0,"ErrorCode":1,"ThrottleSeconds":0,"ErrorStatus":"Success","Message":"Ok","MessageData":{}}'
Payload for Transfer (Item):
{'itemReferenceHash': 1887808042, 'stackSize': 1, 'transferToVault': True, 'itemId': 6917529064365277571, 'characterId': '2305843009334674521', 'membershipType': 1}
Response from Transfer:
'{"Response":0,"ErrorCode":1656,"ThrottleSeconds":0,"ErrorStatus":"DestinyCannotPerformActionOnEquippedItem","Message":"You cannot perform this action on an equipped item.","MessageData":{}}'`
I tested by creating the full Given list of items for my Hunter (2305843009320174499)
placing one of the listed weapons equipped on my Warlock (2305843009334674521) and one on my Titan (2305843009327144242). and scattered the armor between the other states (vault, hunters bag, other characters bag). The same issue occurs for both weapons. All other items are transferred to the hunter and equipped as expected.
Please let me know if you need more information.
Ah, thank you for the thorough report! Definitely sounds like we're returning erroneous success, good info! I'll file a bug shortly.
Just to make sure I'm understanding the details - let's say you have two characters:
CharacterA with unequipped item ItemA
CharacterB with equipped item ItemB
You're attempting to equip ItemA on CharacterB, and it's returning success - thus making it look like the item should then be transferrable?
Just making sure I understand the scenario correctly. In this situation, I think we'll need to return a new result code that indicates the item isn't on the character. Or maybe just ItemNotFound... though perhaps that's too vague.
TFS 735304!
I think this may actually be my fault. Looking into another Issue I found there is a history of actions page on the Bungie.Net account settings page. Filtering for my app made an issue apparent.
Item A: Ether Doctor, Does not replace the Target Item: Ikelos Shotgun.

I'm reworking the way I select Item A now
Ah, okay! Well, let me know if you run into anything more on that front!
(if it helps - you may already be planning this, but just in case... you can check that the inventoryBucketHash matches for the two items you intend to use for the equipping/transferring to make sure one will properly cause the other to unequip when equipped)
Thanks, I'm going to try to find the first item in the returned CharacterInventory where the bucketHash is the same as the Items definition[inventory][bucketTypeHash] value.
Sweet, that should do the trick as long as it can be equipped. Be sure to check the equip status property in case it's not an equippable item: it might be best to iterate through all the items in the given bucket looking for one that's equippable.
Yep, That did the trick. I will look into adding the Equip failure reasons as well. Thank you for helping me look at this!
Sweet! No problem, glad to be of help! And thank you for putting so much info in your bug: I wish I got that much info with every potential bug!