fix(market): make the transfer market work end-to-end (live-verified)
Four defects found by driving a real FIFA 17 client. Each was independently
sufficient to break listing, so all four had to go:
1. Every owned card was shaped `untradeable: true` (adapter item.rs), so the
client greyed out "Place/List on Transfer Market" for the whole club. Owned
and pack-pulled cards are TRADEABLE in FIFA 17; the oracle forces this off
for owned copies too (item_def keeps `true`; instances do not).
2. `POST /auctionhouse` required `itemData.resourceId`, which the client's
FutISStart body never sends (the oracle lists by wire id ALONE). Missing it,
the handler fail-closed and returned 200 while persisting NOTHING. It now
resolves server-side: wire id -> Core owned instance -> its card_id (minted on
a synthetic buy) + FIFA resourceId (the auction record). This also enforces
that a listing can only name a card the club actually owns.
3. An auction record's `itemData` was a 4-field STUB, so the Transfer List had a
row the client could not draw -> "1 item listed" but no visible sale. A
listing now persists a full shaped-card SNAPSHOT (new `listings.item_json`,
additive migration) built by the same `shape_item` shaper `/club` and the
squad projection use, so the auction card renders identically to the club
card. The seller's own pile stamps `itemState: listFS`; market search keeps
`forSale` (the oracle distinguishes these).
4. `/tradePile/counts` shared a handler with `/tradePile`. They are DIFFERENT
deserializers: `/counts` is FutGetAuctionCount, five scalar ints
(count/maxAuctionsAllowed/offered/selling/sold) that it reads and skips
everything else. Served the `auctionInfo` body it left every count at 0, so
the Transfer List screen showed no active sale while the hub tile showed one.
New Route::MarketCounts, classified BEFORE the base tradePile matcher (which
also accepts the /counts path).
Also: a listed card no longer appears in the club. `/club` and the hub's
`clubPlayers` now exclude the transfer pile. Pile membership is host-owned state
Core cannot filter on, so when anything is hidden `/club` reuses the existing
local-filter path (the one `rare=SP` already needed) and paginates the
club-visible set -- letting Core paginate would return short pages. With nothing
hidden the fast Core-paginated path is untouched, and only an EXPLICIT non-club
pile hides a card, so no-pile-row items still default to the club.
Fixed 5 pre-existing test fixtures across 4 targets that listed FABRICATED wire
ids -- only "valid" because the old handler skipped the ownership check.
Tests: 14 targets green + clippy clean, incl. new coverage for the 5-int tally
(asserting it must NOT carry auctionInfo), the full-card snapshot + listFS, and
club pile-exclusion with full-width pagination. The differential test against the
live Python oracle passes.
Verified live on prod: listed=true with a 21-field snapshot; counts
{count:1,selling:1,maxAuctionsAllowed:100}; tradePile renders the 94-rated card;
clubPlayers 1966 -> 1961 (exactly the 5 trade-pile items); listed wire absent
from the club page. Operator confirmed the card is visible in the Transfer List.
This commit is contained in:
@@ -29,10 +29,26 @@ Legend: owner R = Rust/Core, P = Python oracle (:8199 proxied via PYTHON_FALLBAC
|
||||
| PUT /item | R | inv,pile | handle_move_items | NO |
|
||||
| POST /ut/delete/../match | R | coins | handle_match_end | NO |
|
||||
| POST /auctionhouse,/transfermarket | R | listings | handle_market_list | NO |
|
||||
| GET /tradePile[/counts] | R | no | handle_market_query | NO |
|
||||
| GET /tradePile | R | no | handle_market_query | NO |
|
||||
| GET /tradePile/counts | R | no | handle_market_counts | NO |
|
||||
| /trade/<id> (POST/PUT/GET) | R | coins,inv,listings | handle_market_buy | NO |
|
||||
| DELETE /ut/delete/../trade/<id> | R | listings | handle_market_cancel | NO |
|
||||
|
||||
**Transfer-market semantics (live-verified 2026-08-17).** Three things here are
|
||||
load-bearing and were each a live defect:
|
||||
1. `/tradePile` and `/tradePile/counts` are **different deserializers** and MUST NOT
|
||||
share a handler. `/counts` is FutGetAuctionCount: five scalar ints
|
||||
(`count`, `maxAuctionsAllowed`, `offered`, `selling`, `sold`) and nothing else.
|
||||
Served the `auctionInfo` body it skips every field, leaving the counts at 0 — the
|
||||
hub tile shows a listing while the Transfer List screen shows no active sale.
|
||||
2. An auction record's `itemData` MUST be the **full card object** (the same shape
|
||||
`/club` emits), not a stub. A listing therefore persists a shaped-card SNAPSHOT
|
||||
(`listings.item_json`) at list time. The seller's own pile stamps
|
||||
`itemState: listFS`; market search uses `forSale`.
|
||||
3. `POST /auctionhouse` resolves the listed card **server-side** from the wire item
|
||||
id (`wire → Core instance → card_id + resourceId`); the client's FutISStart body
|
||||
carries only the id. This also enforces that you can only list what you own.
|
||||
|
||||
### NON-ECONOMY — Rust-owned (route migration 2026-08-17, OBSERVED prod log)
|
||||
| Route | Owner | Notes |
|
||||
|---|---|---|
|
||||
@@ -41,7 +57,7 @@ Legend: owner R = Rust/Core, P = Python oracle (:8199 proxied via PYTHON_FALLBAC
|
||||
| GET /userMassInfo | R | FULL Rust envelope (userInfo+squad+settings+pileSizeClientData); no Python. coins from Core, squad == /squad/active |
|
||||
| GET/PUT /clientdata/<key> | R | host ClientDataStore (JSON-persisted); PUT acks {}, GET returns blob or {} |
|
||||
| capability (/openfut/fifa17/capability) | R | -> Bound (CleanV1) |
|
||||
| GET /club, /club/* readers | R | Core-backed collection (dropped_no_asset=0) |
|
||||
| GET /club, /club/* readers | R | Core-backed collection (dropped_no_asset=0). Cards in the **transfer pile are excluded** — a listed card has left the club. Pagination then runs over the club-visible set (Core cannot filter on host-owned pile state, so letting it paginate would yield short pages); with nothing hidden the fast Core-paginated path is unchanged. Only an EXPLICIT non-club pile hides a card, so no-pile-row items default to the club. |
|
||||
| GET /squad/0, /squad/active, /squad/list; PUT /squad/<n> | R | Core squad projection + tx; GET /squad/0 == active squad (verified structurally identical) |
|
||||
| GET /user/accountinfo | R | {} |
|
||||
| GET /user | R | `{"userInfo": …}` — same userInfo builder as userMassInfo (shared); squad rating is Core-authoritative (DIFFERENT-BY-DESIGN vs Python's stale value) |
|
||||
@@ -49,7 +65,7 @@ Legend: owner R = Rust/Core, P = Python oracle (:8199 proxied via PYTHON_FALLBAC
|
||||
| GET /leaderboards/options | R | {} |
|
||||
| PUT /match/reset | R | {} |
|
||||
| GET /phishing/trusteddevice | R | security-question stateless ack |
|
||||
| GET /hub | R | Core-derived counts |
|
||||
| GET /hub | R | Core-derived counts; `clubPlayers` excludes transfer-pile cards (1966 → 1961 with 5 listed/moved), `auctionCount`/`tradePile` from the durable market store |
|
||||
| GET /club/stats/{year,consumables,staff,country,league,team} | R | Core aggregation; context buckets keyed nation/league/team (owned=1982); staff={} |
|
||||
| GET /store, /match/keepalive, /captcha, /tfa, /livemessage, /activeMessage | R | unconditional constant acks (byte-identical to the oracle; StaticAck route) |
|
||||
| GET /watchList (+ PUT/POST/DELETE) | R | empty watch list + authoritative Core credits; add/remove is a no-op ack (oracle persists none) |
|
||||
|
||||
Reference in New Issue
Block a user