From fdc2c49991d228e80f1f3aa974df187f28c44077 Mon Sep 17 00:00:00 2001 From: lucio Date: Sun, 23 Aug 2026 23:57:16 -0700 Subject: [PATCH] fix: attendees after 2026-08 Wodify redesign MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- CLAUDE.md | 32 ++++++++++++++++++++++++++++++++ src/wodify/actions.py | 7 ++++++- src/wodify/render.py | 23 +++++++---------------- tests/test_render.py | 9 ++++++++- 4 files changed, 53 insertions(+), 18 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 34651db..2871189 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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 diff --git a/src/wodify/actions.py b/src/wodify/actions.py index c7b1582..5631ef1 100644 --- a/src/wodify/actions.py +++ b/src/wodify/actions.py @@ -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",), diff --git a/src/wodify/render.py b/src/wodify/render.py index 3f59145..1a5568f 100644 --- a/src/wodify/render.py +++ b/src/wodify/render.py @@ -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]: diff --git a/tests/test_render.py b/tests/test_render.py index e00d108..5711487 100644 --- a/tests/test_render.py +++ b/tests/test_render.py @@ -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