Skip to content
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

"Merges the description in the normal object" is modifying the object on the page #201

Open
xPaw opened this issue Jul 14, 2024 · 3 comments

Comments

@xPaw
Copy link
Contributor

xPaw commented Jul 14, 2024

This:

// Merges the description in the normal object, this is done to keep the layout consistent with the market page, which is also flattened.
Object.assign(value, value.description);

I was writing some code for steamdb extension, and assumed the properties I saw on the item were present, but I should have been looking at item.description instead.

Is this merging actually needed?

@Nuklon
Copy link
Owner

Nuklon commented Jul 14, 2024

On inventory page, m_rgAssets holds only basic info where the bulk of the data is inside description. On the market page, m_rgAssets contains everything directly and there the description is empty. It's likely possible to remove this merging entirely, but then all uses need to be checked as the properties are likely under description.

@xPaw
Copy link
Contributor Author

xPaw commented Jul 14, 2024

I've noticed some code already does this, like so:

if (item.market_fee != null)
publisherFee = item.market_fee;
else if (item.description != null && item.description.market_fee != null)
publisherFee = item.description.market_fee;

@Nuklon
Copy link
Owner

Nuklon commented Jul 15, 2024

Yeah, I think it's possible to disable merging, but I think all usages need to be well checked, I think the inventory stuff is pretty easy to fix as it's mostly under the description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants