Skip to content

Conversation

@JEETDESAI25
Copy link
Contributor

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Closes #202

When using smtp_pass in auth config, Terraform fails with "Provider produced inconsistent result after apply" because readAuthConfig() marshals the API response (AuthConfigResponse) with different JSON tags than the update schema (UpdateAuthConfigBody), causing state mismatch.

What is the new behavior?

  • Both readAuthConfig() and updateAuthConfig() now convert API responses to UpdateAuthConfigBody before persisting state, ensuring consistent JSON marshaling.
  • Added convertAuthResponse() and copySensitiveFields() helpers to handle type conversion and preserve write-only fields. Includes regression test with request validation.

Additional context

All tests pass (7/7). Verified with golangci-lint (0 issues).

@JEETDESAI25 JEETDESAI25 requested a review from a team as a code owner November 24, 2025 23:15
Copy link
Collaborator

@savme savme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for jumping in and fixing this, @JEETDESAI25! 🙏
Let's just make a small tweak in the error handling and we’ll be good to merge

@JEETDESAI25 JEETDESAI25 force-pushed the fix/issue-202-smtp-pass branch 2 times, most recently from 8754171 to 6eb3ff0 Compare December 2, 2025 01:31
@savme savme enabled auto-merge (squash) December 2, 2025 06:46
@savme savme force-pushed the fix/issue-202-smtp-pass branch from 6eb3ff0 to d253a76 Compare December 2, 2025 06:46
@savme savme merged commit 0209b09 into supabase:main Dec 2, 2025
6 checks passed
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.

Provider produced inconsistent result after apply in auth SMTP settings

2 participants