Skip to content

chore: remove dead code in the API - #32

Merged
nchourrout merged 1 commit into
mainfrom
chore/remove-dead-code
Nov 14, 2026
Merged

nchourrout merged 1 commit into
mainfrom
chore/remove-dead-code

Conversation

@nchourrout

Copy link
Copy Markdown
Member

A dead-code scan of current main found API code that nothing calls. This PR deletes it. Runtime behavior does not change.

Removed:

  • resetAuth (auth/config.ts) and resetDatabase (db/client.ts): both say "for testing", but no test calls them.
  • getWorkspaceClientCount and getTotalClientCount in sse/manager.ts. These wrappers have no callers; the tests call the hub methods, which stay.
  • isOAuthError and its re-export from mcp-oauth-service.ts. OAuthError stays.
  • apps/api/src/auth/client.ts: a frontend Better Auth client inside the API app that nothing imports.
  • apps/api/src/domain/rate-limit/index.ts: a barrel that domain/index.ts bypasses by importing rate-limit/service.js directly.

No visible change.

Why it is safe

None of the removed symbols is referenced anywhere in the repo (checked with git grep). None of these modules is namespace-imported (import * as), so they cannot be reached dynamically. @flowtask/api is private and no other repo depends on it. TypeScript would reject any static import of a removed symbol, and typecheck passes in every workspace.

Test notes

Ran locally on this branch: bun run lint (0 errors), bun run typecheck (api, web, shared all clean), bun run test (577 pass, 0 fail), bun run build (passes).

If this is wrong, the revert brings everything back.

Drop symbols with no caller anywhere in the repo: resetAuth, resetDatabase,
the getWorkspaceClientCount/getTotalClientCount wrappers in sse/manager
(tests call the hub methods directly), isOAuthError, the unused Better Auth
client in apps/api/src/auth/client.ts, and the rate-limit barrel that
domain/index.ts bypasses.
@nchourrout
nchourrout merged commit 777f749 into main Nov 14, 2026
9 checks passed
@nchourrout
nchourrout deleted the chore/remove-dead-code branch November 14, 2026 10:41
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.

1 participant