Skip to content

Adds Reporting for Steam Failed Trades - #411

Open
Step7750 wants to merge 2 commits into
masterfrom
fix/steam-trade-failed-handling
Open

Adds Reporting for Steam Failed Trades#411
Step7750 wants to merge 2 commits into
masterfrom
fix/steam-trade-failed-handling

Conversation

@Step7750

@Step7750 Step7750 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

It's possible for a Steam trade to hit status 4 (failed) upon offer acceptance.

This PR will push notary proofs if the related trade is for a CSFloat sale, allowing the platform to gracefully handle it.

Ref CSF-1701


Note

Medium Risk
Changes trade verification and notary submission for pending marketplace trades; mistakes could mis-report failures or skip proofs, but logic mirrors rollback and is gated by feature flags and deduplication.

Overview
Steam trades that fail on acceptance (status 4) can now be detected and reported to CSFloat so pending sales can be handled without manual intervention.

The extension pulls failed entries from Steam trade history (API include_failed and filtering for TradeStatus.Failed) and matches them to pending CSFloat trades by asset id and counterparty, skipping trades already linked via steam_trade_failed_id or with an accepted offer. Matched cases trigger background notary proofs (same rollback gate and 60-minute failure backoff), with buildProveRequest now setting include_failed: true.

The periodic CSFloat trade ping runs pingFailedTrades alongside rollback handling and surfaces failed_trades_error on failure. SlimTrade gains optional steam_trade_failed_id for deduplication; unit tests cover matching rules.

Reviewed by Cursor Bugbot for commit 9a9cf8c. Bugbot is set up for automated code reviews on this repo. Configure here.

It's possible for a Steam trade to hit status 4 (failed) upon offer acceptance.

This PR will push notary proofs if the related trade is for a CSFloat sale, allowing the platform to gracefully handle it.

Ref CSF-1701
@Step7750
Step7750 requested a review from GODrums July 31, 2026 00:47
@Step7750 Step7750 added the bug label Jul 31, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9a9cf8c. Configure here.

const csfloatTrade = pendingTrades.find(
(pendingTrade) =>
pendingTrade.state === TradeState.PENDING &&
pendingTrade.steam_offer?.state === TradeOfferState.Active &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Active offer blocks failed matching

Medium Severity

findFailedTrades only matches when steam_offer.state is Active, but status-4 failures happen after the offer is accepted. Steam then reports Accepted, and pingSentTradeOffers can update CSFloat before a notary retry. Unlike rollback matching, this drops the trade permanently after one failed prove or if another party already pinged Accepted.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9a9cf8c. Configure here.

Comment on lines +50 to +60
function tradeHistory(): TradeHistoryStatus {
return {
trade_id: 'steam-trade-id',
status: TradeStatus.Failed,
other_party_url: `https://steamcommunity.com/profiles/${otherPartyID}`,
other_party_id: otherPartyID,
received_assets: [{asset_id: steamAssetID}],
given_assets: [],
time_init: 123,
};
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do these need to be functions? Feels like pendingTrade and tradeHistory might be better suited as static variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants