fix(email): fix Confirm/Update Integration broken in Gmail edit mode#564
Merged
zbigniewsobiecki merged 1 commit intodevfrom Feb 27, 2026
Merged
Conversation
…isting Gmail integration When opening the email wizard in edit mode for an existing Gmail integration, INIT_EDIT set oauthComplete=true but left gmailEmail and verificationEmail as null. This caused two problems: 1. Clicking "Confirm" dispatched SET_VERIFICATION with email: null (state.gmailEmail), so verificationEmail stayed null and the "Update Integration" button remained disabled. 2. The verify step showed "Gmail connection verified for " (empty name). Fix: in the INIT_EDIT useEffect, wait for orgCredentials to load then look up the gmail_email credential (stored as "Gmail: user@example.com") and pre-populate both gmailEmail and verificationEmail. This auto-confirms the verify step for existing integrations so "Update Integration" is immediately enabled, consistent with how IMAP edit mode works. Uses a useRef guard to ensure INIT_EDIT only fires once even though orgCredentials is now a dependency. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
SET_VERIFICATIONwithemail: state.gmailEmail, butgmailEmailwas alwaysnullin edit mode, soverificationEmailstayednullstep3Complete = !!state.verificationEmailevaluated tofalsebecauseverificationEmailwas never populatedRoot cause:
INIT_EDITsetoauthComplete = truefor existing Gmail integrations but never populatedgmailEmailorverificationEmail. The email address was available all along — stored in the credential name as"Gmail: user@example.com"— but never looked up.Fix: wait for
orgCredentialsto load, look up thegmail_emailcredential by ID frominitialCredentials, strip the"Gmail: "prefix from its name, and pre-populate bothgmailEmailandverificationEmail. Uses auseRefguard soINIT_EDITonly fires once even thoughorgCredentialsis now a dependency.After the fix, opening the email wizard on an existing Gmail integration immediately shows the email confirmed and "Update Integration" enabled — no re-verification needed.
Test plan
npm run build:web— cleannpm run lint/npm run typecheck— clean🤖 Generated with Claude Code