fix(market): add FIFA 17 tradeOwner/sellerId, answer trade/status, route plain DELETE
Three defects behind "selecting my own Transfer List listing opens no dialog".
Pressing the card emits NO HTTP at all, so the gate is a field in what we already
return -- the client decides locally from the auction record.
1. OWNERSHIP FIELDS (FIFA17-HISTORICAL). FIFA 17 auctionInfo carries `tradeOwner`
(bool), `sellerId` and `offers`; we emitted none of them. `tradeOwner` is the
purpose-built "this auction is mine" flag, and without it the Transfer List has
nothing to key owner actions (Remove / Re-list) on. `sellerId` now carries the
configured persona so it agrees with `tradeOwner` and `sellerName` instead of
telling three different stories. Persona is threaded from config, never baked in.
2. `GET …/trade/status` ANSWERED EMPTY (CONFIRMED from our own live logs). The
Transfer List polls this continuously to refresh live auction state. The tail has
no numeric id, so it fell through `t.starts_with("trade")` into the buy/view arm,
where `trade_id_from_path` fails and the reply is `{"auctionInfo": []}`. The
client asked for the state of its own listings and was repeatedly told there was
none. Now a real handler: `tradeIds` filter, or the whole active pile unfiltered;
unknown ids are absent rather than an error, so a poll never fails closed.
3. PLAIN `DELETE …/trade/<id>` WAS A SILENT NO-OP. Contemporaneous FIFA 17 clients
cancel via `DELETE /ut/game/<sku>/trade/<id>`; only the oracle's
`/ut/delete/game/…` spelling mapped to MarketCancel, so the plain form landed in
the buy/view arm and "cancelled" nothing while returning 200. Both spellings now
map to MarketCancel. Kept the oracle spelling: the differential exercises it.
Why the differential missed all of this: our record's key set was IDENTICAL to the
oracle's, so parity was green. The oracle omits the ownership fields too, because
its own remove flow was never driven by a real client either. The differential now
asserts we COVER every oracle key and that our extra keys are EXACTLY
{offers, sellerId, tradeOwner} -- so an unexplained new divergence still fails,
while the deliberate superset is pinned.
Deliberately NOT changed (no evidence): itemState stays "listFS", expires stays
3600 seconds-remaining, bidState stays "none" for active/unbid, counts stays
count=1, and no FIFA 18+ price fields were added.
332 tests pass, 0 failed, clippy clean. Deployed and verified live: tradeOwner=true
sellerId=33068179 sellerName='CAGE' offers=0 on /tradePile AND /trade/status
(filtered and unfiltered).
This commit is contained in:
@@ -910,10 +910,28 @@ fn run_differential(core_base: &str, oracle: &Oracle, dir: &std::path::Path) {
|
||||
k.sort();
|
||||
k
|
||||
};
|
||||
// Our record is a deliberate SUPERSET of the oracle's. The oracle omits the
|
||||
// FIFA 17 ownership fields entirely, which is exactly why parity could not
|
||||
// catch the Actions-panel bug: the field was missing on BOTH sides, because the
|
||||
// oracle's own remove flow was never driven by a real client either. So assert
|
||||
// (a) we cover every key the oracle emits, and (b) the extra keys are precisely
|
||||
// the ownership set we added on purpose — a NEW unexplained divergence still
|
||||
// fails here.
|
||||
let (ok, rk) = (keys(o_rec), keys(r_rec));
|
||||
for k in &ok {
|
||||
assert!(rk.contains(k), "rust tradePile record is missing oracle key `{k}`");
|
||||
}
|
||||
let extra: Vec<&String> = rk.iter().filter(|k| !ok.contains(k)).collect();
|
||||
assert_eq!(
|
||||
keys(o_rec),
|
||||
keys(r_rec),
|
||||
"tradePile auction-record key set parity"
|
||||
extra,
|
||||
vec!["offers", "sellerId", "tradeOwner"],
|
||||
"the ONLY keys we add beyond the oracle are the FIFA 17 ownership fields"
|
||||
);
|
||||
// The ownership story must be internally consistent on our side.
|
||||
assert_eq!(r_rec["tradeOwner"], true, "own pile listing is owned by us");
|
||||
assert_eq!(
|
||||
r_rec["sellerId"], PERSONA_ID,
|
||||
"sellerId agrees with tradeOwner"
|
||||
);
|
||||
for f in [
|
||||
"sellerName",
|
||||
|
||||
Reference in New Issue
Block a user