Fix: Local Parsing for new Inspect Link Format#373
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix prepared fixes for all 3 issues found in the latest run.
- ✅ Fixed:
full_item_namenever populated, breaks StatTrak/Souvenir detection- Added getFullItemName function to construct full_item_name from quality field (9=StatTrak, 12=Souvenir) combined with weapon_type and item_name.
- ✅ Fixed: Wear name boundaries use wrong comparison operator
- Changed first four comparisons in getWearName from <= to < to use exclusive upper bounds matching CS2 wear condition ranges.
- ✅ Fixed: Inspect link returned without placeholder replacement for old format
- Added fallback handling to replace %owner_steamid%, %assetid%, and %listingid% placeholders in old format inspect links across all three affected files.
Or push these changes by commenting:
@cursor push bc7711efa5
Preview (bc7711efa5)
diff --git a/src/lib/bridge/handlers/fetch_inspect_info.ts b/src/lib/bridge/handlers/fetch_inspect_info.ts
--- a/src/lib/bridge/handlers/fetch_inspect_info.ts
+++ b/src/lib/bridge/handlers/fetch_inspect_info.ts
@@ -87,6 +87,9 @@
console.error('Failed to fetch schema item metadata:', error);
}
+ const quality = decoded.quality ?? 0;
+ const fullItemName = getFullItemName(quality, weaponType, itemName);
+
return {
iteminfo: {
stickers: decoded.stickers.map((sticker) => ({
@@ -104,7 +107,7 @@
defindex,
paintindex,
rarity: decoded.rarity ?? 0,
- quality: decoded.quality ?? 0,
+ quality,
paintseed: decoded.paintseed ?? 0,
inventory: decoded.inventory ?? 0,
origin: decoded.origin ?? 0,
@@ -115,6 +118,7 @@
item_name: itemName,
rarity_name: rarityName,
wear_name: getWearName(floatvalue),
+ full_item_name: fullItemName,
},
};
}
@@ -140,19 +144,19 @@
}
function getWearName(floatvalue: number): string | undefined {
- if (floatvalue <= 0.07) {
+ if (floatvalue < 0.07) {
return 'Factory New';
}
- if (floatvalue <= 0.15) {
+ if (floatvalue < 0.15) {
return 'Minimal Wear';
}
- if (floatvalue <= 0.38) {
+ if (floatvalue < 0.38) {
return 'Field-Tested';
}
- if (floatvalue <= 0.45) {
+ if (floatvalue < 0.45) {
return 'Well-Worn';
}
@@ -160,3 +164,18 @@
return 'Battle-Scarred';
}
}
+
+function getFullItemName(quality: number, weaponType?: string, itemName?: string): string | undefined {
+ if (!weaponType || !itemName) {
+ return;
+ }
+
+ let prefix = '';
+ if (quality === 9) {
+ prefix = 'StatTrak™ ';
+ } else if (quality === 12) {
+ prefix = 'Souvenir ';
+ }
+
+ return `${prefix}${weaponType} | ${itemName}`;
+}
diff --git a/src/lib/components/common/item_holder_metadata.ts b/src/lib/components/common/item_holder_metadata.ts
--- a/src/lib/components/common/item_holder_metadata.ts
+++ b/src/lib/components/common/item_holder_metadata.ts
@@ -95,12 +95,15 @@
return;
}
- const link = this.asset?.actions![0].link;
+ let link = this.asset?.actions![0].link;
if (link.includes('%propid:6%')) {
const propId = this.asset.asset_properties?.find((p) => p.propertyid === 6)?.string_value;
if (!propId || !link) return;
return link.replace('%propid:6%', propId);
}
+
+ link = link.replace('%owner_steamid%', this.ownerSteamId);
+ link = link.replace('%assetid%', this.assetId || '');
return link;
}
diff --git a/src/lib/components/inventory/selected_item_info.ts b/src/lib/components/inventory/selected_item_info.ts
--- a/src/lib/components/inventory/selected_item_info.ts
+++ b/src/lib/components/inventory/selected_item_info.ts
@@ -94,12 +94,15 @@
return;
}
- const link = this.asset.description?.actions![0].link;
+ let link = this.asset.description?.actions![0].link;
if (link.includes('%propid:6%')) {
const propId = this.asset.asset_properties?.find((p) => p.propertyid === 6)?.string_value;
if (!propId || !link) return;
return link.replace('%propid:6%', propId);
}
+
+ link = link.replace('%owner_steamid%', g_ActiveInventory.m_owner.strSteamId);
+ link = link.replace('%assetid%', this.asset.assetid);
return link;
}
diff --git a/src/lib/components/market/helpers.ts b/src/lib/components/market/helpers.ts
--- a/src/lib/components/market/helpers.ts
+++ b/src/lib/components/market/helpers.ts
@@ -12,12 +12,15 @@
const asset = g_rgAssets[AppId.CSGO][ContextId.PRIMARY][listingInfo.asset.id!];
if (!asset || !asset.market_actions?.length) return;
- const link = asset.market_actions[0].link;
+ let link = asset.market_actions[0].link;
if (link.includes('%propid:6%')) {
const propId = asset.asset_properties?.find((p) => p.propertyid === 6)?.string_value;
if (!propId || !link) return;
return link.replace('%propid:6%', propId);
}
+
+ link = link.replace('%listingid%', listingId);
+ link = link.replace('%assetid%', listingInfo.asset.id || '');
return link;
}This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adapts the extension according to the new inspect link format by parsing it locally. Uses our schema to get min/max float values.
Does NOT address Steam's missing asset description bug when looking at others' inventories yet.
Unsupported features:
Note
Medium Risk
Moderate risk because it replaces the inspect-info source from a remote API call to local link decoding plus cached schema fetching, and updates inspect-link construction across inventory/market flows; errors here can break float/metadata display.
Overview
Switches
FETCH_INSPECT_INFOfrom calling the CSFloat API to local parsing of inspect links via@csfloat/cs2-inspect-serializer, then enriches results with min/max float + names by fetching and caching the CSFloat schema inchrome.storage.local(newschema_fetcher+SCHEMA_CACHE).Updates inspect-link generation in inventory, selected-item, and market listing helpers to support the new
%propid:6%placeholder (including backfillingasset_propertieson inconsistent Steam inventory structures), and adds the new dependency/typing + ESLint rule relaxation fornamespacetypes.Written by Cursor Bugbot for commit 12b2bd0. Configure here.