chore: remove dead code and simplify conditionals#1459
Merged
Conversation
0f71dc9 to
46d82bc
Compare
- Remove unused dec2hex helper and its tests in gotrue - Remove unused Constants.defaultAudience and defaultExpiryMargin and their tests - Remove stale avoid-unnecessary-type-assertions ignores in postgrest_builder (no longer flagged by DCM, so the ignores were unused) - Simplify == false check in functions_client to use ! - Reorder duplicate _saveSession log statements
46d82bc to
75d1eb8
Compare
grdsdev
approved these changes
Jun 24, 2026
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.
What
Low-risk cleanups found while scanning the packages for dead code and simplification opportunities. No behavior changes.
Dead code removed (gotrue)
dec2hex()inhelper.dart— unused, not exported, only referenced by its own test group (removed the test group too).Constants.defaultAudienceandConstants.defaultExpiryMargin— unused, andConstantsis hidden from the public export so this is not a breaking change (removed their test cases too).Simplifications
functions_client.dart:headers.containsKey("Content-Type") == false→!headers.containsKey("Content-Type").gotrue_client.dart: reordered the duplicate_saveSessionlogs so the coarsefineline precedes the detailedfinest.Verification
dart analyze lib testpasses with no issues for the affected packages.dcm analyzepasses with no issues.This is the first of several cleanup PRs. Larger refactors (extracting duplicated logic) follow in separate PRs.