fix: attendees after 2026-08 Wodify redesign

- endpoint moved: WodifyClient_Class/Classes/Class/ActionGetClassAttendees
  (old Schedule_OS GetClassAttendees no longer fires anywhere in the app)
- render.attendees() delegates to attendee_rows() — PersonName, not Name
- test fixtures updated to ClassDetailAttendee.List wire shape
- CLAUDE.md: diagnosis notes (path re-prefix + lazy attendee action)

prime now captures 8/8 actions; 138 tests pass
This commit is contained in:
lucio committed 2026-08-23 23:57:16 -07:00
1 parent ae3c39b384
commit fdc2c49991
4 files changed
+53 -18

No files matched your search

+32
View File
@@ -279,6 +279,38 @@ STALE: schedule: Wodify redeployed (module changed=True, api changed=False). Re-
Exit 3, no fallback, no guess. Intended behaviour, fired unprompted.
### The 2026-08 redesign: attendees moved, paths re-prefixed
Wodify redeployed around 2026-08-22 and broke `attendees` in two independent
ways. Both are fixed; recorded so the next redesign is faster to diagnose.
1. **Every data action gained a `WodifyClient_DataFetch_WB/` prefix** (e.g.
`Schedule_OS/GetClassList_ForClient_WithReservationCounts_WB/...` now lives
under `WodifyClient_DataFetch_WB/Schedule_OS/...`). Symptom was subtle:
cached apiVersions kept working, so everything *except* never-captured
actions kept answering — and re-prime could not recapture anything new,
because `_observe` matches captured paths exactly against the allowlist.
2. **`GetClassAttendees` is gone entirely.** No request by that name fires
anywhere in the app now, on any screen, including scroll. The class screen
sources its roster from a different endpoint:
`WodifyClient_Class/Classes/Class/ActionGetClassAttendees` (note: no
`_WB`, no `DataAction` infix — ServiceAPI style). It only fires when a
class is opened from the Scheduler UI, which the existing workout walk
already does.
Diagnosis recipe that found both: attach CDP with a request observer, click
through Home → Schedule → a class, and dump every `/screenservices/` path
(probe script pattern in git history, `probe4.py`). Grepping the dump for
the missing action's name fragments (`Attendee`) reveals its new home.
The response shape also changed: attendees now arrive as
`Response.ClassDetailAttendee.List[].{PersonName, StatusInClass, ...}` —
which `render.attendee_rows` already handled, but the CLI's `attendees`
command had its own older inline renderer that only knew `Name`/
`FirstName+LastName` and silently printed "No attendees listed." for every
class. Rule reinforced: **there must be exactly one attendee-shape parser**;
`render.attendees()` now delegates to `attendee_rows()`.
### Publishing
Test fixtures use **fictional** names. Real gym members' names were scrubbed and the git
+6 -1
View File
@@ -87,7 +87,12 @@ ACTIONS: dict[str, Action] = {
),
Action(
key="attendees",
path=f"{_FETCH}/Schedule_OS/GetClassAttendees_WB/DataActionGetClassAttendees",
# 2026-08 Wodify redesign: the old
# Schedule_OS/GetClassAttendees_WB/DataActionGetClassAttendees
# no longer fires anywhere in the app. The class screen now sources
# its attendee list from this ServiceAPI-style action instead, and
# it only triggers when a class is opened from the Scheduler.
path="WodifyClient_Class/Classes/Class/ActionGetClassAttendees",
view_name="Classes.Class",
summary="Who is signed up for a class",
inputs=("Request",),
+7 -16
View File
@@ -267,23 +267,14 @@ def attendee_block(data: Any, *, booked: Any = None, limit: Any = None) -> str:
def attendees(data: Any) -> str:
rows = first_list(data)
names = []
for row in rows:
if not isinstance(row, dict):
continue
flat: dict[str, Any] = dict(row)
for value in row.values():
if isinstance(value, dict):
flat.update(value)
name = flat.get("Name") or " ".join(
str(flat[k]) for k in ("FirstName", "LastName") if flat.get(k)
)
if name:
names.append(str(name).strip())
if not names:
# Route through attendee_rows: it knows the real field names (PersonName,
# not Name -- see its docstring and the CLAUDE.md field-trap table). The
# old inline Name/FirstName logic silently rendered "No attendees listed."
# for every class once responses switched to ClassDetailAttendee.List.
rows = attendee_rows(data)
if not rows:
return "No attendees listed."
return f"{len(names)} attendees: " + ", ".join(names)
return f"{len(rows)} attendees: " + ", ".join(r["name"] for r in rows)
def _real_records(rows: Any) -> list[dict]:
+8 -1
View File
@@ -50,7 +50,14 @@ def test_bookings_formats_rows():
def test_attendees_counts_and_lists():
data = {"Response": {"List": [{"Name": "A B"}, {"Name": "C D"}]}}
# Current wire shape (2026-08 redesign): ClassDetailAttendee.List with
# PersonName. The pre-redesign {"Response": {"List": [{"Name": ...}]}}
# shape is covered by attendee_rows' fallbacks; the CLI view must render
# the shape the service actually returns today.
data = {"Response": {"ClassDetailAttendee": {"List": [
{"PersonName": "A B", "StatusInClass": "Reserved"},
{"PersonName": "C D", "StatusInClass": "Reserved"},
]}}}
out = render.attendees(data)
assert out.startswith("2 attendees:") and "A B" in out and "C D" in out