-
-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disallow vendorItems without vendorHash from showing up in compareCategoryItemsSelector #10381
Disallow vendorItems without vendorHash from showing up in compareCategoryItemsSelector #10381
Conversation
I'm not familiar with these vendors - what are they? Should we be building vendor items for items without a valid vendor at all? |
Example: Defiant Armor https://data.destinysets.com/i/Vendor:4264351379 More details in #10262's comments. |
Makes sense, though it does seem like those should have a |
Will we ever set vendorHash nonzero for vendorItemForDefinitionItem? (Is that a case where we'd want these no-stat items to show up in Compare so that they show which vendor they actually come from e.g. "Sold by: Defiant Armor" instead of "Sold by: --"?) |
I'm not sure. I guess they don't need to have them to be displayed on the vendors page. Is the problem on the Compare page that they have no vendor, or that they have no stats? |
The original issue was that they had no vendor and would outright crash DIM, I papered over that while investigating the root cause, but the issue linked here is to specifically exclude them from the Compare pane due to not having any useful stats to compare (I'd assume, @nev-r can chime in on it).
I've run into another fun bug that exists on Live while testing things for this: These no-stat items only have the itemCategoryHash for the class they're for, not the equipment slot, so categoryItems in compareCategoryItemsSelector gets everything for that class. This is true even for ones that have a valid vendorHash e.g. the ones in Zavala's Focused Decoding section. |
Probably we do, though I can't think of anything that requires that.
Probably yes, if the items have stats / perks. But not if they don't.
No, it'd be best if those items were not "comparable".
That feels like a good thing to fix as well. |
The problem with that is that if the user does have something similar to that item in their inventory, then the compare window should come up with those items, ignoring the dummy item that the 'Compare' originally came from. But we don't want the item tooltip to search through the user's inventory every time just to be able to figure out whether to show Compare or not... Depending on how we fix this, the itemCategoryHash issue may end up moot, I guess. |
Should it? Launching Compare from an item is meant to compare that item to other items, not to generically find similar items. |
Sorry, by "similar to that item" I meant same copies of that item for the initial compare that they may have in their inventory or available as not-dummy items from other vendors, with the option to expand to e.g. other arm-slot items via the category selectors if they desire. Just excluding the no-stat items. |
Yup, I understand. I'm just calling out that I think it'd be OK for that to be out of scope for Compare. |
...If we change the text on the button we could call it "See my copies" or something less verbose, and have an error/warning toast show up in the top right "Could not find any versions of that item in your inventory" instead of a no-op if the player doesn't have any other versions of that item. Thoughts? It's kind of out of scope of the linked issue but also a pretty elegant way to solve it with a new feature. |
I think that makes sense. The toast isn't so elegant but probably easier than an empty compare sheet. |
86b579d
to
ffad3ad
Compare
showNotification({ | ||
type: 'warning', | ||
title: t('Compare.Error.Invalid'), | ||
body: session.query, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I should include this but session doesn't have any other info about the item attempting to be compared.
…egoryItemsSelector
…ems available to compare it against
232c6cd
to
0d84770
Compare
@bhollis does the use of |
@FlaminSarge it's not required, but it would be good to include it. If you include it, every time the query changes and there still aren't results, you'll get another notification. |
Fixes #10279
When an item being considered for Compare has a vendor but does NOT have a vendorHash, it is DQ'd. Items from
allItems
won't have vendors (since they're player inventory items) and items invendorItems
should all have vendors, but the invalid ones will havevendorHash=0
.This is the most direct way to prevent the linked issue, solely affecting Compare view without potentially having side effects on any other view.
The alternative solutions for this involved making a change here: https://github.com/DestinyItemManager/DIM/blob/master/src/app/vendors/selectors.ts#L122
either by adding
vs.component?.canPurchase
or!vs.def.inhibitBuying
checks inside afilter
.I did not know how the alternative solution would affect things other than Compare. I also wasn't too clear on how canPurchase and inhibitBuying differed, either, so I didn't go for the alternative solution.
Of note that
loadout-builder-vendors.ts
's selection already enforces a particular set of allowed vendors, but it could probably make use of a check such as canPurchase or inhibitBuying instead of that.