Skip to content

chore(usage): remove unused fetchUsage()#327

Open
dobby-coder[bot] wants to merge 1 commit into
mainfrom
chore/remove-dead-fetchusage
Open

chore(usage): remove unused fetchUsage()#327
dobby-coder[bot] wants to merge 1 commit into
mainfrom
chore/remove-dead-fetchusage

Conversation

@dobby-coder

@dobby-coder dobby-coder Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Removes fetchUsage() from src/lib/usage.ts. It performed a pre-flight GET /usage?email=... against the cryptify backend but was never called — a tree-wide search finds only its definition. The live usage query was added in #110 (2026-04-23) and never wired into the UI; sender quotas are enforced by the server 413 backstop (parseLimitExceededBody) plus the browser-local estimate in src/lib/localUsage.ts.

  • Deleted fetchUsage().
  • Dropped the now-unused FILEHOST_URL from the usage.ts import (ROLLING_LIMIT stays).
  • classifyUsage, UsageResponse and UsageStatus are untouched — still reachable through parseLimitExceededBody.
  • Refreshed the CLAUDE.md note that described the never-built UsageWarning/fetchUsage path so the doc matches the tree.

No behavioural test applies: this only removes unreferenced code, and svelte-check would fail if anything still referenced the symbol. Verified locally with npm run check, npm run lint, npm run test:unit, and npm run build — all pass. Same pattern as the recently merged #326 (removing unused GetBrowserInfo()).

Closes #323

fetchUsage() did a pre-flight GET /usage against cryptify but was never
called anywhere — a tree-wide search finds only the definition. The live
usage path from #110 was never wired into the UI; the app relies on the
server 413 backstop (parseLimitExceededBody) plus the browser-local
estimate in localUsage.ts.

Removing it leaves FILEHOST_URL unused in usage.ts, so drop it from the
import (ROLLING_LIMIT stays). classifyUsage, UsageResponse and
UsageStatus stay — still reachable via parseLimitExceededBody.

Also refresh the stale CLAUDE.md note that described the never-built
UsageWarning/fetchUsage path.

Closes #323

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dobby-coder
dobby-coder Bot requested a review from rubenhensen July 25, 2026 00:20

@dobby-coder dobby-coder Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

VERDICT: approve

Rules + review sign-off, cycle 1. No blocking findings.

Checked against main: fetchUsage has no callers (only its definition), and FILEHOST_URL stays in use elsewhere through its own imports, so dropping it from the usage.ts import line is safe. classifyUsage, UsageResponse and UsageStatus remain reachable through parseLimitExceededBody. The CLAUDE.md note now matches the tree. CI is green across the board, the title passes the Conventional Commit check, a reviewer is assigned, and Closes #323 is registered as a closing reference.

One rule-check candidate (PR body length vs the no-justification-paragraphs rule) was dismissed: issue #323 explicitly asked for a product call between removing and wiring up the function, so the body documenting why removal is safe is warranted here.

@dobby-coder
dobby-coder Bot marked this pull request as ready for review July 25, 2026 00:28
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.

Dead code: unused fetchUsage() in src/lib/usage.ts

0 participants