Bungie-net / api

Resources for the Bungie.net API
Other
1.22k stars 92 forks source link

Items transferring from vault can pick up locked status from similar items #764

Open archived-2f4dd0 opened 5 years ago

archived-2f4dd0 commented 5 years ago

right now, for me, using the API to transfer an item vault->character is locking the item

this occurs in DIM, and bungie companion app, but for the sake of something to paste here, i am including DIM info

encountering randomly locked equipment has been regular ever since i started using external tools, but seemed less frequent until recently. any insight? thanks!

vthornheart-bng commented 5 years ago

Could I have you go to your View Profile -> Application History tab on Bungie.net? I'd love to see the output of that in relation to the actions you took in DIM - particularly if there are separate line items in the history for "Transfer to Vault" and "Lock Item". If you can find a situation in that history where you had an equip followed by a lock, could you take a screenshot of your history page where you see it and post it here?

ArkahnX commented 5 years ago

This is the move to vault

    "activityId": "6423944838",
    "details": {
        "activityType": 1001,
        "activityDescription": "Transfer to Vault",
        "creationDate": "2018-11-09T20:24:53.57Z",
        "membershipId": "7278357",
        "itemSummary": {
            "itemReferenceHash": 636912560,
            "iconPath": "/common/destiny2_content/icons/4b068eddf020f2f272d83998f210e33b.jpg",
            "name": "Dust Rock Blues",
            "itemType": "Shotgun"
        },
        "characterId": "2305843009265193659",
        "characterSummary": {
            "iconPath": "/common/destiny2_content/icons/c89eb559068c19f8ed62d56a47f33cfa.jpg",
            "className": "Titan",
            "light": 328,
            "level": 25
        },
        "membershipType": 2,
        "destinyMembershipId": "4611686018435648983",
        "stackSize": 0,
        "outcome": 1,
        "outcomeDescription": "Ok"
    },
    "application": {
        "applicationId": 16281,
        "name": "Destiny Item Manager Beta Website",
        "link": "https://destinyitemmanager.com"
    }
}

And this is the move back to character

    "activityId": "6423945700",
    "details": {
        "activityType": 1000,
        "activityDescription": "Transfer from Vault",
        "creationDate": "2018-11-09T20:25:03.945Z",
        "membershipId": "7278357",
        "itemSummary": {
            "itemReferenceHash": 636912560,
            "iconPath": "/common/destiny2_content/icons/4b068eddf020f2f272d83998f210e33b.jpg",
            "name": "Dust Rock Blues",
            "itemType": "Shotgun"
        },
        "characterId": "2305843009265193659",
        "characterSummary": {
            "iconPath": "/common/destiny2_content/icons/c89eb559068c19f8ed62d56a47f33cfa.jpg",
            "className": "Titan",
            "light": 328,
            "level": 25
        },
        "membershipType": 2,
        "destinyMembershipId": "4611686018435648983",
        "stackSize": 0,
        "outcome": 1,
        "outcomeDescription": "Ok"
    },
    "application": {
        "applicationId": 16281,
        "name": "Destiny Item Manager Beta Website",
        "link": "https://destinyitemmanager.com"
    }
}

interestingly I'm noticing that it has my Titan as level 25 and light 328, however it should be level 50 light 597 (you can validate that with the characterId and membershipId from the request) seems like a bug

quick edit to say that there is no reported lock happening, so a bug in the transfer api?

vthornheart-bng commented 5 years ago

Did the item actually lock for you on transfer @ArkahnX ? I've been trying it and I can't get it to repro.

I did notice that lock and equip are right next to each other in the long press menu of the Companion - is it possible that this was an accidental click of lock rather than transfer? If so, it'd show up as a lock command in the activity history.

archived-2f4dd0 commented 5 years ago

sorry, had that info and spaced on including it. this generates no lock event in the API, neither in overall nor filtering for locks. i can post a screenshot but it would just be of a "Transfer from Vault" event. i have only one "Lock Item" event this month, and it's not related to the dozen times i reproduced this earlier.

this is definitely not a misclick in companion app, nor DIM. careful clicking happened and i was watching the network inspector the whole time.

vthornheart-bng commented 5 years ago

Does this happen every time you transfer an item to the vault, or intermittently?

archived-2f4dd0 commented 5 years ago

locked for me every time without fail this morning. this afternoon it seems intermittent again.

vthornheart-bng commented 5 years ago

Very interesting. Were you playing the game at the time, and now aren't playing it (or vice versa)? Is there any actions you're taking outside of the game while using the app?

I've yet to get a repro of this after a couple hundred attempts, so I'm fishing for possible scenarios where it might be reproducing.

Is it possible that the item was already locked previously and you didn't notice it was locked until after you inspected it in the vault? Just checking on all possibilities.

cowgod commented 5 years ago

I just wanted to chime in with the probably-not-very-helpful comment that this happens to me all the time as well, and has for as long as I've been using companion apps, even back into D1. Moving items from one character to another using Ishtar Commander or DIM would frequently (but not every single time) toggle the lock status, either locking things that were unlocked or unlocking things that were locked. Since every transfer between characters is really a transfer to the vault and another transfer out of the vault, it jives with this bug.

Next time I notice it happen, I'll post the same logs from the View Profile -> Application History tab on Bungie.net, to help add more data points.

vthornheart-bng commented 5 years ago

Very interesting! Yes, that would be great if you could do so - this is the first I've heard of it, and I'd love to get more info in an attempt to reproduce it.

archived-2f4dd0 commented 5 years ago

yeah i don't know how to not sound crazy here but i am lifelong tech support and triple checking everything as i do it, i should have gotten video while it was consistent this morning.

the item is confirmed unlocked *in-game (canonical info i figure), then transferred. then it is locked status in-game.

vthornheart-bng commented 5 years ago

Also, if you can send the name of the item being transferred when it happens, that could be useful too. Perhaps certain items or types of items are automatically triggering some side effect on transfer that is causing their lock state to toggle, and I just happen to not have them.

archived-2f4dd0 commented 5 years ago

today, this happened with 4 different go figures, an arsenic bite, and a botheration.

vthornheart-bng commented 5 years ago

Filing a bug now. Anyone who has had this happen to them, definitely send any info you can:

vthornheart-bng commented 5 years ago

TFS 735171

archived-2f4dd0 commented 5 years ago

Logs of the API interaction:

req: characterId: "2305843009349935002" itemId: "6917529081104182361" itemReferenceHash: 4138174248 membershipType: 4 stackSize: 1 transferToVault: true response: {"Response":0,"ErrorCode":1,"ThrottleSeconds":0,"ErrorStatus":"Success","Message":"Ok","MessageData":{}}

req: characterId: "2305843009351995689" itemId: "6917529081104182361" itemReferenceHash: 4138174248 membershipType: 4 stackSize: 1 transferToVault: false response: {"Response":0,"ErrorCode":1,"ThrottleSeconds":0,"ErrorStatus":"Success","Message":"Ok","MessageData":{}}

req: characterId: "2305843009351995689" itemId: "6917529081104182361" itemReferenceHash: 4138174248 membershipType: 4 stackSize: 1 transferToVault: true response: {"Response":0,"ErrorCode":1,"ThrottleSeconds":0,"ErrorStatus":"Success","Message":"Ok","MessageData":{}}

req: characterId: "2305843009349935002" itemId: "6917529081104182361" itemReferenceHash: 4138174248 membershipType: 4 stackSize: 1 transferToVault: false response: {"Response":0,"ErrorCode":1,"ThrottleSeconds":0,"ErrorStatus":"Success","Message":"Ok","MessageData":{}}

This was performed while I was logged in to watch the item's lock status. The item started unlocked and finished locked.

attached: unfiltered API logs at the time

524s2t

floatingatoll commented 5 years ago

Can you get the Set-Cookie: ...; bungled=VALUE; ... response HTTP header for those HTTP responses, or reproduce the issue again and collect it then?

On Nov 9, 2018, at 13:31, sundevour notifications@github.com wrote:

Logs of the API interaction:

req: characterId: "2305843009349935002" itemId: "6917529081104182361" itemReferenceHash: 4138174248 membershipType: 4 stackSize: 1 transferToVault: true response: {"Response":0,"ErrorCode":1,"ThrottleSeconds":0,"ErrorStatus":"Success","Message":"Ok","MessageData":{}}

req: characterId: "2305843009351995689" itemId: "6917529081104182361" itemReferenceHash: 4138174248 membershipType: 4 stackSize: 1 transferToVault: false response: {"Response":0,"ErrorCode":1,"ThrottleSeconds":0,"ErrorStatus":"Success","Message":"Ok","MessageData":{}}

req: characterId: "2305843009351995689" itemId: "6917529081104182361" itemReferenceHash: 4138174248 membershipType: 4 stackSize: 1 transferToVault: true response: {"Response":0,"ErrorCode":1,"ThrottleSeconds":0,"ErrorStatus":"Success","Message":"Ok","MessageData":{}}

req: characterId: "2305843009349935002" itemId: "6917529081104182361" itemReferenceHash: 4138174248 membershipType: 4 stackSize: 1 transferToVault: false response: {"Response":0,"ErrorCode":1,"ThrottleSeconds":0,"ErrorStatus":"Success","Message":"Ok","MessageData":{}}

This was performed while I was logged in to watch the item's lock status. The item started unlocked and finished locked.

attached: unfiltered API logs at the time

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

archived-2f4dd0 commented 5 years ago

when i can get it to repeat, yep

vthornheart-bng commented 5 years ago

Does it only happen when you're playing the game at the same time as using DIM, only when you're not playing, or a mix?

ArkahnX commented 5 years ago

I can say my experience was:

vthornheart-bng commented 5 years ago

Have you ever had an experience where, in moving it, it got UNlocked?

vthornheart-bng commented 5 years ago

OH MAN

This is great, I'm so glad you guys reported this - I'm kind of excited about this bug! Indeed if it's what I'm suspecting, it may have been happening since D1 and slipped right under our radar.

Okay, so can I have you guys test something? Can you see if, when this happens, there's a separate item with the same, identical name already in your inventory that you had intentionally locked?

cowgod commented 5 years ago

Oh, interesting. I’ll check that specifically next time it happens. Are you looking specifically in the same bucket as the item that gets its lock status toggled incorrectly, or ANYWHERE in the account’s inventory, including on some other character?

vthornheart-bng commented 5 years ago

Oh, specifically in the source bucket it looks like - the container from which the item is being transferred.

I'll see if I can try this out in prod as well.

vthornheart-bng commented 5 years ago

Yep, sure enough it repro'd. Well I'll be damned.

Thank you guys for reporting this! I'll see what we can do to fix it up. This has indeed almost certainly been a bug since the very beginning days of D1.

A workaround for those of you experiencing this is a bit janky, but unlock any items in that inventory bucket of the exact same item hash before you transfer, and then re-lock them. That way no other items of the same hash in that bucket will accidentally pass their locked status onto the item being transferred. (for instance, if you have two Transversive Steps and one is locked, and you try to transfer the unlocked one, there is a chance it can inherit the other Transversive Steps' locked state!)

It'd be interesting to try this in-game to see if it repros there too. It looks like it ought to, I'll have to try that when I get some time as well.

cowgod commented 5 years ago

Glad you were able to reproduce it! This has been bugging me since the Taken King days, so I’m excited it was identified. Curious to hear how feasible a fix will be.

vthornheart-bng commented 5 years ago

Oy, that is a very good question. There's a fix that I think will be easy (though slow to release, because we have to fix it game side and wait for a deployment window) for instanced items. For non-instanced items, like stacks of currency... that could potentially get hairier. Yucky. But also fascinating. :) ha

floatingatoll commented 5 years ago

You can reproduce this issue in-game:

https://www.youtube.com/watch?v=0ab1fUZffMg

On Nov 9, 2018, at 17:24, Vendal Thornheart notifications@github.com wrote:

Oh, specifically in the source container it looks like - the container from which the item is being transferred.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

floatingatoll commented 5 years ago

Which currencies permit locking? Do vendors honor locking when selecting from which stack if any to consume their price?

I have no currencies that permit locking in-game.

On Nov 9, 2018, at 17:49, Vendal Thornheart notifications@github.com wrote:

Oy, that is a very good question. There's a fix that I think will be easy (though slow to release, because we have to fix it game side and wait for a deployment window) for instanced items. For non-instanced items, like stacks of currency... that could potentially get hairier. Yucky.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

vthornheart-bng commented 5 years ago

Thanks for the evidence! I've passed it onto the game team, along with my analysis of a potential fix.

It could be that no stack items/non-instanced items permit locking by convention - indeed, that is possible. But there's nothing stopping the designers from making one that does allow it, so I'm unfortunately unsure if there is such an item! We'll find out once the game side folks have a look at it.

archived-2f4dd0 commented 5 years ago

this makes perfect sense why i could repeat it so consistently earlier since i was moving around a mixed set of 6-8 go figures. thanks so much for looking into it!

vthornheart-bng commented 5 years ago

Thanks for reporting it! This was an interesting one!

vthornheart-bng commented 5 years ago

For those interested in more information, as I just realized I didn't really explain it in the workaround mentioned above...

The source of this problem is that the item's "states" (currently only lock/unlock state, and the old tracked/untracked state) are the only non-quantity-related properties that are stored on an item's "slot" in your inventory rather than on the item itself. This is because all other data related to an item is stored on an item's "instance", but the game needed (or at least, the engine allows us) to be able to track and lock non-instanced items. Thus this specific data got stored on the item's current slot, and on transfer gets moved to the destination slot separately from the item itself.

The item itself gets moved properly and in a transactionally safe way. But the item's lock/tracked state is discovered via a second, buggy codepath where it tries to find the first item in the source inventory bucket where an item with the same item hash is located. If you have two items in your inventory bucket that happen to have the same item hash (such as two instances of a specific weapon), it will copy the locked/tracked state of the first one it finds, regardless of if it was the item that got moved.

cowgod commented 5 years ago

Thanks for the explanation, I was very curious about how exactly the bug was happening. It's great you were able to track this down, it has been frustrating for years to never be fully confident that something I've locked will truly stay locked and not accidentally get deleted at some point in the future. I know the fix isn't going to happen immediately but I'm just glad it's in the works.

floatingatoll commented 5 years ago

FYI, someone reported an instance of this today. Either that's as-expected ("it wasn't fixed which is why the issue isn't closed") or that's a surprise ("it was fixed but the issue wasn't closed"). Duly noted in case it's the latter, otherwise good luck storming the castle etc :)

vthornheart-bng commented 5 years ago

Indeed, unfortunately it's something that's deeper on the game side and isn't likely to be fixed. Which is a bummer.

vthornheart-bng commented 5 years ago

Though let me check with them - I think at least the instanced items version should be fixable/may have already been fixed. Uninstanced items though I'm pretty sure got punted to the deep dark of the backlog.