Skip to content

chore: remove dead code and simplify conditionals#1459

Merged
spydon merged 1 commit into
mainfrom
chore/cleanup-dead-code-simplifications
Jun 24, 2026
Merged

chore: remove dead code and simplify conditionals#1459
spydon merged 1 commit into
mainfrom
chore/cleanup-dead-code-simplifications

Conversation

@spydon

@spydon spydon commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What

Low-risk cleanups found while scanning the packages for dead code and simplification opportunities. No behavior changes.

Dead code removed (gotrue)

  • dec2hex() in helper.dart — unused, not exported, only referenced by its own test group (removed the test group too).
  • Constants.defaultAudience and Constants.defaultExpiryMargin — unused, and Constants is 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 _saveSession logs so the coarse fine line precedes the detailed finest.

Verification

  • dart analyze lib test passes with no issues for the affected packages.
  • dcm analyze passes with no issues.
  • gotrue constants and helper tests pass.

This is the first of several cleanup PRs. Larger refactors (extracting duplicated logic) follow in separate PRs.

@spydon spydon requested a review from a team as a code owner June 24, 2026 09:30
@spydon spydon force-pushed the chore/cleanup-dead-code-simplifications branch from 0f71dc9 to 46d82bc Compare June 24, 2026 09:36
- 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
@spydon spydon force-pushed the chore/cleanup-dead-code-simplifications branch from 46d82bc to 75d1eb8 Compare June 24, 2026 09:49
@spydon spydon closed this Jun 24, 2026
@spydon spydon reopened this Jun 24, 2026
@spydon spydon merged commit 2f7ecaa into main Jun 24, 2026
64 of 66 checks passed
@spydon spydon deleted the chore/cleanup-dead-code-simplifications branch June 24, 2026 13:14
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.

2 participants