Skip to content

Commit 1b61cdb

Browse files
committed
Disables Fetching Floats for "Bugged" Market Listings
1 parent 1be97c2 commit 1b61cdb

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

src/lib/components/market/item_row_wrapper.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,28 @@ export class ItemRowWrapper extends FloatElement {
118118
}
119119
}
120120

121+
/**
122+
* As part of the March 2/2026 update, skins listed on SCM get moved into the trade protected inventory context
123+
* so the user can still use them in-game while listed. However, Valve introduced a bug where these skins
124+
* can't be inspected in game.
125+
*
126+
* Detect and skip these skins to prevent overloaded errors to the user and browser request throttling.
127+
*/
128+
get isBuggedSkin(): boolean {
129+
if (!this.asset || !isSkin(this.asset)) {
130+
return false;
131+
}
132+
133+
if (this.asset.unowned_contextid !== "16") {
134+
// Only applies for trade protected inventory context
135+
return false;
136+
}
137+
138+
const fv = (this.asset.asset_properties || []).find((prop) => prop.propertyid === 2);
139+
// Has no FV
140+
return !fv;
141+
}
142+
121143
@state()
122144
private itemInfo: ItemInfo | undefined;
123145
@state()
@@ -143,6 +165,10 @@ export class ItemRowWrapper extends FloatElement {
143165
return;
144166
}
145167

168+
if (this.isBuggedSkin) {
169+
return;
170+
}
171+
146172
try {
147173
this.itemInfo = await this.fetchFloat();
148174
} catch (e: any) {
@@ -236,6 +262,10 @@ export class ItemRowWrapper extends FloatElement {
236262
return nothing;
237263
}
238264

265+
if (this.isBuggedSkin) {
266+
return nothing;
267+
}
268+
239269
if (this.itemInfo && isSkin(this.asset)) {
240270
const fadePercentage = this.asset && getFadePercentage(this.asset, this.itemInfo)?.percentage;
241271

src/lib/types/steam.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,25 @@ export interface rgDescription {
7171
}[];
7272
}
7373

74+
type RequireOnlyOne<T, Keys extends keyof T = keyof T> =
75+
Pick<T, Exclude<keyof T, Keys>>
76+
& {
77+
[K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, never>>
78+
}[Keys];
79+
80+
interface rgAssetPropertyBase {
81+
propertyid: number;
82+
int_value?: string;
83+
float_value?: string;
84+
string_value?: string;
85+
}
86+
87+
// Only one of int_value, float_value, or string_value can be present
88+
type rgAssetProperty = RequireOnlyOne<
89+
rgAssetPropertyBase,
90+
'int_value' | 'float_value' | 'string_value'
91+
>;
92+
7493
// g_rgAssets
7594
export interface rgAsset extends rgDescription {
7695
amount: number;
@@ -86,6 +105,7 @@ export interface rgAsset extends rgDescription {
86105
unowned_contextid: string;
87106
unowned_id: string;
88107
element?: HTMLElement;
108+
asset_properties?: rgAssetProperty[];
89109
}
90110

91111
export interface rgInventoryAsset {

0 commit comments

Comments
 (0)