fifa17-recon: /club honours ?team= and ?league= -- drill-downs showed the whole club
Reported live: a Cristiano Ronaldo card appearing under Chelsea and under Arsenal. The data was right and so was the client. teamid 243 really is Real Madrid in the game's own teams table, and all eight Ronaldo cards in the live CardsDb map read teamid 243. The fault was ours: club_route parsed only ?type= and ignored ?team= and ?league=, so clicking a club or a league in the club panel was answered with the ENTIRE 194-item club. Every drill-down therefore contained every player. Note which half was already correct: the club/stats COUNTS were fixed yesterday and were right (England 11, Premier League 17). It was only the item list behind them that was unfiltered, which is why this looked like a data bug and was not one. Now: team=5 gives 26 items, team=243 gives 20, league=13 gives 22, and the unfiltered club list is untouched at 194. 439 checks green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VUT92pz6RWKih9dSr8ZpxW
This commit is contained in:
@@ -1435,11 +1435,31 @@ def club_route(h):
|
||||
# disturb them. An unrecognised type is treated like manager -- filtered, not
|
||||
# unfiltered -- since answering an unknown question with the whole player list
|
||||
# is what produced this bug in the first place.
|
||||
kind = ""
|
||||
q = {}
|
||||
if "?" in h.path:
|
||||
for part in h.path.split("?", 1)[1].split("&"):
|
||||
if part.startswith("type="):
|
||||
kind = part[5:]
|
||||
if "=" in part:
|
||||
k, v = part.split("=", 1)
|
||||
q[k] = v
|
||||
kind = q.get("type", "")
|
||||
|
||||
# HONOUR ?team= AND ?league=. These are the CLUB DRILL-DOWNS: clicking Chelsea in
|
||||
# the club panel issues team=5, clicking the Premier League issues league=13.
|
||||
# They were ignored, so every drill-down was answered with the ENTIRE club and
|
||||
# Cristiano Ronaldo showed up under Chelsea, Arsenal and everyone else. Reported
|
||||
# live 2026-08-05. The counts on the stats panel were right all along; it was
|
||||
# only the item list that was unfiltered.
|
||||
for param, field in (("team", "teamid"), ("league", "leagueId")):
|
||||
raw = q.get(param)
|
||||
if raw is None:
|
||||
continue
|
||||
try:
|
||||
want = int(raw)
|
||||
except ValueError:
|
||||
continue
|
||||
items = [i for i in items if i.get(field) == want]
|
||||
log(" CLUB: %s=%d -> %d item(s)" % (param, want, len(items)))
|
||||
|
||||
if kind and kind not in ("player", "custom"):
|
||||
# cardsubtypeid 0..3 is a player (FUN_1800d8330); everything else is
|
||||
# staff or a manager. We own no staff cards yet, so this is [] today --
|
||||
|
||||
Reference in New Issue
Block a user