fix: correct westsidebasktball email typo in KNOWN_ACCOUNTS #10

Open
opened 2026-04-16 22:16:43 +00:00 by forgejo_admin · 0 comments

Type

Bug

Lineage

Standalone — discovered during session setup for draneylucas@gmail.com OAuth. Pre-existing local drift in ~/gmail-mcp/src/gmail_mcp/accounts.py added westsidebasketball to KNOWN_ACCOUNTS but never committed, and the drift mapped to a non-existent email address.

Repo

forgejo_admin/gmail-mcp

What Broke

Two coupled defects in src/gmail_mcp/accounts.py:KNOWN_ACCOUNTS:

  1. The westsidebasketball alias is missing from the committed upstream dict (only present as local uncommitted drift on the main-session machine).
  2. The uncommitted drift maps the alias to westsidebasketball@gmail.com — an address that does not exist. The real account is westsidebasktball@gmail.com (no e in basketball) — a Gmail-side typo documented in sop-gmail-oauth.

As a result, resolve_account("westsidebasktball@gmail.com") (the real email) does not match any value in KNOWN_ACCOUNTS and falls through the unknown-alias passthrough at accounts.py:42-43, attempting to load gmail-westsidebasktball@gmail.com.json — a stale token file that used to exist on disk. Silent wrong-token resolution hazard.

Repro Steps

  1. Fresh-clone forgejo_admin/gmail-mcp (avoids local drift).
  2. Call resolve_account("westsidebasktball@gmail.com").
  3. Observe: returns the literal string "westsidebasktball@gmail.com" — treated as a custom alias — rather than resolving to "westsidebasketball".
  4. Downstream token load attempts SECRETS_DIR / "gmail-westsidebasktball@gmail.com.json".

Expected Behavior

  • resolve_account("westsidebasketball")"westsidebasketball" (alias match)
  • resolve_account("westsidebasktball@gmail.com")"westsidebasketball" (email reverse-lookup hits)
  • resolve_account("westsidebasketball@gmail.com") → literal passthrough (no match — intended; that address doesn't exist)

Environment

  • Repo: forgejo_admin/gmail-mcp @ a05df92 (main HEAD)
  • File: src/gmail_mcp/accounts.py:7-12
  • Consumed by: gmail-mcp server (stdio MCP), SECRETS_DIR=~/secrets/google-oauth
  • Related SOP: sop-gmail-oauth (documents the Gmail typo)

Acceptance Criteria

  • KNOWN_ACCOUNTS contains "westsidebasketball": "westsidebasktball@gmail.com" (committed to main)
  • Passing the real email as account= resolves to the westsidebasketball alias
  • No regression for existing callers using account="westsidebasketball"
  • Token filename convention preserved (gmail-westsidebasketball.json)
  • Stale token file archived at ~/secrets/google-oauth/archive/ (done out-of-band)
  • pal-e-platform — project
  • sop-gmail-oauth — documents the typo and token management
  • Predecessor PRs: #7 (reauth tools), #5 (CI)
### Type Bug ### Lineage Standalone — discovered during session setup for `draneylucas@gmail.com` OAuth. Pre-existing local drift in `~/gmail-mcp/src/gmail_mcp/accounts.py` added `westsidebasketball` to `KNOWN_ACCOUNTS` but never committed, and the drift mapped to a non-existent email address. ### Repo `forgejo_admin/gmail-mcp` ### What Broke Two coupled defects in `src/gmail_mcp/accounts.py:KNOWN_ACCOUNTS`: 1. The `westsidebasketball` alias is missing from the committed upstream dict (only present as local uncommitted drift on the main-session machine). 2. The uncommitted drift maps the alias to `westsidebasketball@gmail.com` — an address that does not exist. The real account is `westsidebasktball@gmail.com` (no `e` in `basketball`) — a Gmail-side typo documented in `sop-gmail-oauth`. As a result, `resolve_account("westsidebasktball@gmail.com")` (the real email) does not match any value in `KNOWN_ACCOUNTS` and falls through the unknown-alias passthrough at `accounts.py:42-43`, attempting to load `gmail-westsidebasktball@gmail.com.json` — a stale token file that used to exist on disk. Silent wrong-token resolution hazard. ### Repro Steps 1. Fresh-clone `forgejo_admin/gmail-mcp` (avoids local drift). 2. Call `resolve_account("westsidebasktball@gmail.com")`. 3. Observe: returns the literal string `"westsidebasktball@gmail.com"` — treated as a custom alias — rather than resolving to `"westsidebasketball"`. 4. Downstream token load attempts `SECRETS_DIR / "gmail-westsidebasktball@gmail.com.json"`. ### Expected Behavior - `resolve_account("westsidebasketball")` → `"westsidebasketball"` (alias match) - `resolve_account("westsidebasktball@gmail.com")` → `"westsidebasketball"` (email reverse-lookup hits) - `resolve_account("westsidebasketball@gmail.com")` → literal passthrough (no match — intended; that address doesn't exist) ### Environment - Repo: `forgejo_admin/gmail-mcp` @ `a05df92` (main HEAD) - File: `src/gmail_mcp/accounts.py:7-12` - Consumed by: `gmail-mcp` server (stdio MCP), `SECRETS_DIR=~/secrets/google-oauth` - Related SOP: `sop-gmail-oauth` (documents the Gmail typo) ### Acceptance Criteria - [ ] `KNOWN_ACCOUNTS` contains `"westsidebasketball": "westsidebasktball@gmail.com"` (committed to main) - [ ] Passing the real email as `account=` resolves to the `westsidebasketball` alias - [ ] No regression for existing callers using `account="westsidebasketball"` - [ ] Token filename convention preserved (`gmail-westsidebasketball.json`) - [ ] Stale token file archived at `~/secrets/google-oauth/archive/` (done out-of-band) ### Related - `pal-e-platform` — project - `sop-gmail-oauth` — documents the typo and token management - Predecessor PRs: `#7` (reauth tools), `#5` (CI)
Sign in to join this conversation.
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
forgejo_admin/gmail-mcp#10
No description provided.