fix: remove dead Home-variant GetClasses; classes now aliases schedule
The remaining open item. Probing settled it: the Home-variant GetClasses returns placeholder records even when the real client calls it -- confirmed by capturing the app's own request/response pair during a live walk (200, ~10 KB, zero real records, empty ScheduleList). Every screen-variable override (WBDataFetchIsComplete, IsLoading, ProgramsWithHistory, all date/program combos) changes nothing. It is not parameter-gated; it is empty by design. So the fix is honesty, not persistence: the action is removed from the allowlist (a test pins it out so it cannot quietly return), and `wodify classes` becomes an argparse alias of `schedule`, the class-list action that actually returns data. `schedule` also gains the default-to-today behaviour the old command had. 134 tests, no network required. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
1 parent
1d0fd9c8ca
commit
8ab4ad4b17
5 files changed
+77
-19
No files matched your search
+7
-10
@@ -107,8 +107,13 @@ ACTIONS: dict[str, Action] = {
|
||||
inputs=("Request",),
|
||||
),
|
||||
# The schedule screen's class list, with reservation counts. This is the
|
||||
# one that actually populates; `classes` below (the Home variant) returns
|
||||
# placeholder records only.
|
||||
# only class-list action that returns data.
|
||||
#
|
||||
# Do NOT re-add WodifyClient_Class/Classes/Attendance/DataActionGetClasses:
|
||||
# it returns placeholder records (Id "0", empty ScheduleList) even when the
|
||||
# real client itself calls it -- confirmed by capturing the app's own
|
||||
# request/response pair during a live walk (200, ~10 KB, zero real
|
||||
# records). It is not parameter-gated; it is empty by design.
|
||||
Action(
|
||||
key="schedule",
|
||||
path=f"{_FETCH}/Schedule_OS/GetClassList_ForClient_WithReservationCounts_WB"
|
||||
@@ -117,14 +122,6 @@ ACTIONS: dict[str, Action] = {
|
||||
summary="All classes on a given day, with reservation counts",
|
||||
inputs=("In_Request",),
|
||||
),
|
||||
Action(
|
||||
key="classes",
|
||||
path="WodifyClient_Class/Classes/Attendance/DataActionGetClasses",
|
||||
view_name="Classes.Attendance",
|
||||
summary="Classes via the Home screen variant (returns placeholders; "
|
||||
"prefer 'schedule')",
|
||||
inputs=("Request",),
|
||||
),
|
||||
Action(
|
||||
key="waitlist",
|
||||
path=f"{_FETCH}/Schedule_OS/GetClassWaitList_WB/DataActionGetClassWaitList",
|
||||
|
||||
+7
-2
@@ -147,7 +147,10 @@ def build_parser() -> argparse.ArgumentParser:
|
||||
|
||||
for key in actions.keys():
|
||||
action = actions.ACTIONS[key]
|
||||
p = sub.add_parser(key, help=action.summary)
|
||||
# `classes` survives as an alias: the action it used to name returns
|
||||
# placeholders even when the real client calls it, so it was removed.
|
||||
aliases = ["classes"] if key == "schedule" else []
|
||||
p = sub.add_parser(key, help=action.summary, aliases=aliases)
|
||||
p.add_argument("--json", action="store_true", help="raw JSON instead of text")
|
||||
p.add_argument("--date", default=None, metavar="YYYY-MM-DD",
|
||||
help="target date (default: today for date-scoped actions)")
|
||||
@@ -169,6 +172,8 @@ def build_parser() -> argparse.ArgumentParser:
|
||||
|
||||
def main(argv: list[str] | None = None) -> int:
|
||||
args = build_parser().parse_args(argv)
|
||||
if args.command == "classes": # alias for the action that actually works
|
||||
args.command = "schedule"
|
||||
if args.command == "list":
|
||||
from . import listcmd
|
||||
return listcmd.dispatch(args)
|
||||
@@ -176,7 +181,7 @@ def main(argv: list[str] | None = None) -> int:
|
||||
return cmd_doctor(args)
|
||||
if args.command == "prime":
|
||||
return cmd_prime(args)
|
||||
if getattr(args, "date", None) is None and args.command in ("workout", "classes"):
|
||||
if getattr(args, "date", None) is None and args.command in ("workout", "schedule"):
|
||||
args.date = _today()
|
||||
return cmd_query(args)
|
||||
|
||||
|
||||
Reference in new issue
Block a user