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
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.
- +0Prompt · +0In the input form, it happen this error: why? (Load failed on registration submit)
- +0mAgent did · +0mInvestigated 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.
- +0mPrompt · +0mThe tournament is started: how can i see the updates?
- +0mAgent did · +0mFound 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.
- +0mFail · +0mThree test rows (__TEST_CURL__, __PROBE_webkit__ etc.) created while probing the endpoint earlier leaked into squadre.json and appeared on the live team list.
- +1mPrompt · +1mI can't see all the teams in the frontend, why? excel has ~40 teams, website only shows 22
- +1mAgent did · +1mTraced 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.
- +1mPrompt · +1mThe official site shows two closed games with results already. Can you check if the API you're using is correct?
- +1mAgent did · +1mConfirmed 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.
- +2mPrompt · +2mWhy is punteggio under 0? Show only points earned, apply the -2 malus only after the elimination stage starts.
- +2mOutcome · +2mReworked 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.
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.