Repository navigation
chore: remove dead code in the API - #32
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) andresetDatabase(db/client.ts): both say "for testing", but no test calls them.getWorkspaceClientCountandgetTotalClientCountinsse/manager.ts. These wrappers have no callers; the tests call the hub methods, which stay.isOAuthErrorand its re-export frommcp-oauth-service.ts.OAuthErrorstays.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 thatdomain/index.tsbypasses by importingrate-limit/service.jsdirectly.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/apiis 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.