Skip to content

refactor: dedupe bucket payload and OAuth launch logic - #1463

Merged
spydon merged 1 commit into
mainfrom
refactor/bucket-oauth-dedupe
Jun 24, 2026
Merged

refactor: dedupe bucket payload and OAuth launch logic#1463
spydon merged 1 commit into
mainfrom
refactor/bucket-oauth-dedupe

Conversation

@spydon

@spydon spydon commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What

Two more duplicated blocks extracted into helpers:

  • storage_clientcreateBucket and updateBucket built the same request payload map. Extracted into _bucketPayload(id, bucketOptions).
  • supabase_fluttersignInWithOAuth and linkIdentity had identical launch logic (parse URL, force external browser for Google on Android, launchUrl). Extracted into _launchAuthUrl(url, provider, authScreenLaunchMode).

No behavior change.

Verification

  • dart analyze lib and dcm analyze pass with no issues for both packages.
  • All supabase_flutter tests pass (51) and all storage_client unit tests pass. (The storage integration tests fail locally only because they need a running storage server: Connection refused.)

Note: This branch also removes two stale avoid-unnecessary-type-assertions ignores in postgrest_builder.dart. They are flagged as unused by the DCM version used in CI (a pre-existing failure on main, present on every PR). Including it keeps this PR's pipeline green; it drops out cleanly once another PR carrying the same fix lands.

- Extract the duplicated bucket request payload in StorageBucketApi
  (createBucket/updateBucket) into _bucketPayload.
- Extract the duplicated OAuth/identity-link launch logic in SupabaseAuth
  (signInWithOAuth/linkIdentity) into _launchAuthUrl.

Also removes two stale avoid-unnecessary-type-assertions ignores in
postgrest_builder (unused per the DCM version used in CI; pre-existing
failure on main).
@spydon
spydon requested a review from a team as a code owner June 24, 2026 10:04
@spydon spydon closed this Jun 24, 2026
@spydon spydon reopened this Jun 24, 2026
@spydon
spydon merged commit c5f9b24 into main Jun 24, 2026
59 of 61 checks passed
@spydon
spydon deleted the refactor/bucket-oauth-dedupe branch June 24, 2026 13:15
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