Skip to content

Debug and fix live tournament scoring pipeline for a fantasy football site

Session from merchantscroll-traces on Hugging Face by vedalken · MIT · condensed by Coders Talk

2msession
0interventions
GOAL

Diagnose why a Google Apps Script registration form was failing for a user and, once the tournament went live, fix the deployment and scoring pipeline so team registrations and live points appear correctly on the site.

  1. Prompt · +0
    In the input form, it happen this error: why? (Load failed on registration submit)
  2. Agent did · +0m
    Investigated registration.js, api.js and the Apps Script backend; tested the endpoint with curl and a Playwright WebKit probe, confirming CORS and the POST/redirect flow work fine. Concluded 'Load failed' is a device/network-level failure on the user's phone, not a code bug.
  3. Prompt · +0m
    The tournament is started: how can i see the updates?
  4. Agent did · +0m
    Found that auto-update commits push with GITHUB_TOKEN, which never triggers the deploy workflow, so GitHub Pages was frozen a day stale. Restructured update-scores.yml to call deploy.yml directly via workflow_call, triggered a manual deploy, and bumped a slow registration fetch timeout.
  5. Fail · +0m
    Three test rows (__TEST_CURL__, __PROBE_webkit__ etc.) created while probing the endpoint earlier leaked into squadre.json and appeared on the live team list.
  6. Prompt · +1m
    I can't see all the teams in the frontend, why? excel has ~40 teams, website only shows 22
  7. Agent did · +1m
    Traced the mismatch to a 10-minute browser cache window that served a stale build; changed fetchLocal in api.js to use cache: 'no-cache' so data files revalidate via ETag/304 instead of being served from cache, verified live in WebKit showing 36 teams.
  8. Prompt · +1m
    The official site shows two closed games with results already. Can you check if the API you're using is correct?
  9. Agent did · +1m
    Confirmed the API base URL was correct but found /api/fixtures silently drops a match from the list the instant it's closed. Rewrote scrape.js to track every fixture id ever seen and refetch each by id so closed results survive, recovering the missing matches and fixing the golden test's stale hardcoded fixture count.
  10. Prompt · +2m
    Why is punteggio under 0? Show only points earned, apply the -2 malus only after the elimination stage starts.
  11. Outcome · +2m
    Reworked compute-scores.js and build-classifica.js to hold back the rule-6 malus until a men's knockout fixture closes; pushed commit 0783b19, deploy succeeded, live classifica now shows real point totals (e.g. 4 and 2) instead of everyone being negative.
VERDICT

Next time I'd lead with 'the malus is making everyone's score negative during the group stage, only show earned points until knockouts' since that was the change that actually mattered to users watching the live tournament. The correction that did the work was catching that /api/fixtures silently drops closed matches from its list — without spotting that, no scores would ever have appeared at all. The GITHUB_TOKEN not triggering deploy.yml was also a real, non-obvious root cause worth calling out up front.

I tried this · 0

Discussion · 0

How Builds work