Contract schedule data comes from two sources — config path and dynamic path conflict #52

Closed
opened 2026-04-12 21:45:07 +00:00 by forgejo_admin · 0 comments
Contributor

Type

Bug

Lineage

Standalone — discovered during contract schedule investigation 2026-04-12.

Repo

forgejo_admin/westside-contracts

What Broke

Contract pages have two independent sources for practice schedule data:

  1. teams.contract_config JSONB → data.config.practices (config-driven path, PRs #44-#48)
  2. practice_schedules table → data.practices (dynamic query, PR #50-#51)

When a team has contract_config, the config path renders config.practices and the dynamic practices array is ignored. When config.practices is empty, the section heading renders with no content and no fallback message. The fee description also derives practice count from config.practices.length, showing "0 practices" when the array is empty.

It is unclear which source is authoritative for each team. Some teams have data in both places. Some have data in only one. The two sources can disagree.

Repro Steps

  1. Load contract for a player on a team with contract_config set
  2. Observe: schedule comes from config.practices, not practice_schedules table
  3. Load contract for a player on a team without contract_config
  4. Observe: schedule comes from practice_schedules table (fallback path)

Expected Behavior

One authoritative source for practice schedule data, consistently used across all contracts.

Environment

  • Cluster/namespace: prod / westside-contracts
  • Service: westside-contracts (SvelteKit adapter-node)
  • Database: basketball (shared with basketball-api)

Acceptance Criteria

  • Single authoritative source for practice schedules on contracts
  • Fee description practice count matches rendered schedule
  • Fallback message when no schedule data exists from any source
  • westside-basketball — project this affects
  • PR #50, PR #51 — added dynamic path
  • PRs #44-#48 — added config-driven path
  • story:WS-S28 — parent sees correct practice schedule
### Type Bug ### Lineage Standalone — discovered during contract schedule investigation 2026-04-12. ### Repo `forgejo_admin/westside-contracts` ### What Broke Contract pages have two independent sources for practice schedule data: 1. `teams.contract_config` JSONB → `data.config.practices` (config-driven path, PRs #44-#48) 2. `practice_schedules` table → `data.practices` (dynamic query, PR #50-#51) When a team has `contract_config`, the config path renders `config.practices` and the dynamic `practices` array is ignored. When `config.practices` is empty, the section heading renders with no content and no fallback message. The fee description also derives practice count from `config.practices.length`, showing "0 practices" when the array is empty. It is unclear which source is authoritative for each team. Some teams have data in both places. Some have data in only one. The two sources can disagree. ### Repro Steps 1. Load contract for a player on a team with `contract_config` set 2. Observe: schedule comes from `config.practices`, not `practice_schedules` table 3. Load contract for a player on a team without `contract_config` 4. Observe: schedule comes from `practice_schedules` table (fallback path) ### Expected Behavior One authoritative source for practice schedule data, consistently used across all contracts. ### Environment - Cluster/namespace: prod / westside-contracts - Service: westside-contracts (SvelteKit adapter-node) - Database: `basketball` (shared with basketball-api) ### Acceptance Criteria - [ ] Single authoritative source for practice schedules on contracts - [ ] Fee description practice count matches rendered schedule - [ ] Fallback message when no schedule data exists from any source ### Related - `westside-basketball` — project this affects - PR #50, PR #51 — added dynamic path - PRs #44-#48 — added config-driven path - `story:WS-S28` — parent sees correct practice schedule
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/westside-contracts#52
No description provided.