Skip to content

Cfb Expansion + App Testing - #15

Merged
RickArko merged 18 commits into
mainfrom
cfb
Jul 6, 2026
Merged

Cfb Expansion + App Testing#15
RickArko merged 18 commits into
mainfrom
cfb

Conversation

@RickArko

@RickArko RickArko commented Jul 6, 2026

Copy link
Copy Markdown
Owner

No description provided.

RickArko and others added 15 commits July 1, 2026 22:19
Keep expanded CFB branch features (draft, waivers, trades, live refresh)
while incorporating main's defensive category mapping for CFB players.

Co-authored-by: Cursor <cursoragent@cursor.com>
Require week on waiver claims, guard FAAB against multi-claim overspend,
validate trade items before persistence, clamp completed draft pick display,
and clean up draft SSE subscriber entries when the last client disconnects.

Co-authored-by: Cursor <cursoragent@cursor.com>
…e Manager.

Replaces magic-link-only Create Account with email/password registration,
forgot-password flow, and a header control to set a password after magic-link sign-in.

Co-authored-by: Cursor <cursoragent@cursor.com>
Return league_id as strings from the discover endpoint so IDs above
Number.MAX_SAFE_INTEGER are not corrupted before import, and surface
clearer import/API error messages when Sleeper calls fail.

Co-authored-by: Cursor <cursoragent@cursor.com>
League import no longer downloads the 15 MB Sleeper /players/nfl map, which
was exhausting the 256 MB Fly machine and returning proxy 502s. Bump VM memory
to 512 MB for draft-help and cache the player map on disk when it is needed.

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the league import and web app auth experience, with supporting test updates and expanded deployment/config documentation. In particular, Sleeper imports now load the Sleeper player DB (with caching) so imported rosters resolve to player name/position/team immediately.

Changes:

  • Add disk-backed caching for the Sleeper /players/nfl map and use it during Sleeper league import to enrich rosters.
  • Update League Manager web app auth flow to support password-based signup/sign-in, password reset, and “set password” for existing users.
  • Refresh tests and documentation for new IDs/config workflows and Fly/Supabase deployment guidance.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/test_sleeper_import.py Adds coverage ensuring Sleeper import loads the player DB and resolves roster fields.
tests/test_league_api.py Updates test data to validate Sleeper league_id is returned as a string.
src/ffpy/web/league_app/app.js Adds password-based auth UI/actions (signup/signin/reset/set password) and improves request error messages.
src/ffpy/league_api.py Loads Sleeper player map during import; normalizes Sleeper league_id to string; wraps import errors with logging.
src/ffpy/draft_strategy.py Adds disk cache for Sleeper player map (TTL-based) in addition to in-memory caching.
src/ffpy/database.py Enables SQLite foreign keys and changes league deletion logic.
scripts/bootstrap.sh Updates bootstrap output instructions and adds Supabase/Fly pointers.
README.md Documents required .env keys by workflow and secret handling locations.
QUICKSTART.md Adds explicit setup steps for web auth + Supabase verification + Fly secrets.
fly.toml Sets VM sizing (512MB, shared CPU) for Fly deployment.
docs/deployment/fly.md Reworks Fly deployment docs into a clearer “happy path” with required env vars and CI token placement.
.env.example Reorganizes and clarifies required keys by workflow; adds Supabase/Fly guidance.
Comments suppressed due to low confidence (2)

src/ffpy/database.py:3785

  • delete_user_league() deletes from league_matchups/league_teams before deleting from user_leagues. If the provided user_id does not match (or the league row doesn't exist), this will still wipe the league's teams/matchups even though the user_leagues row is not removed. Delete from the parent table first (scoped by user_id) and rely on ON DELETE CASCADE now that foreign_keys is enabled.
    def delete_user_league(self, league_id: str, user_id: str) -> None:
        """Delete a league and its teams/matchups."""
        self.conn.execute("DELETE FROM league_matchups WHERE league_id = ?", (league_id,))
        self.conn.execute("DELETE FROM league_teams WHERE league_id = ?", (league_id,))
        self.conn.execute(
            "DELETE FROM user_leagues WHERE league_id = ? AND user_id = ?",
            (league_id, user_id),
        )

src/ffpy/web/league_app/app.js:610

  • signIn() validates trimmed password but sends untrimmed email/password to Supabase. Leading/trailing whitespace (common when copy/pasting) will cause auth failures. Trim both before calling signInWithPassword.
        this._ensureSupabase();
        if (!(this.authForm.password || "").trim()) {
          throw new Error("Enter your password.");
        }
        const { data, error } = await this.supabaseClient.auth.signInWithPassword({
          email: this.authForm.email,
          password: this.authForm.password,
        });

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ffpy/web/league_app/app.js Outdated
Comment thread src/ffpy/web/league_app/app.js Outdated
Comment thread src/ffpy/draft_strategy.py Outdated
Comment thread src/ffpy/league_api.py Outdated
RickArko and others added 3 commits July 6, 2026 15:06
Use correct password autocomplete and trim sign-in credentials, update
account copy for password-based auth, fix delete_user_league to rely on
CASCADE without wiping data for wrong owners, return generic import 502
messages, and align Sleeper player-map docstring with import usage.

Co-authored-by: Cursor <cursoragent@cursor.com>
@RickArko
RickArko merged commit a3be179 into main Jul 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants