fix(AGENT-617): forward credential props in recursive NodeInputHandler tab calls#857
Conversation
…r tab calls Addresses PR #824 review feedback from Max Techera. The original fix added credential state management to NodeInputHandler.jsx, but didn't handle the recursive rendering scenario when GoogleDrivePicker is inside tabs. Changes: - Accept credential props (selectedCredential, selectedCredentialData, handleCredentialDataChange) in component signature - Use props with fallback to local state for nested component support - Forward credential props in recursive tab rendering call - Add PropTypes for new props - Notify parent via callback when credential data changes This ensures GoogleDrivePicker works correctly in both direct usage and when nested inside tabs in Canvas/Chatflow views. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Review: Fix Credential Props Forwarding in NodeInputHandlerSummaryThis PR addresses a critical issue where credential props were not being forwarded in recursive tab rendering calls within ✅ Strengths
🔍 Code Quality Observations1. Recursive Call Location ✅The props are correctly forwarded at line 1037-1039 in the only recursive call location (tab rendering). Good job identifying this! 2. Optional Chaining ✅Proper use of handleCredentialDataChangeProp?.(credData)3. Dependency Array ✅The useCallback((credData) => { ... }, [handleCredentialDataChangeProp])💡 Suggestions for Improvement1. State Synchronization Issue
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de1c22288f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // State for Google Drive/Gmail credential handling | ||
| const [selectedCredential, setSelectedCredential] = useState(data.credential || null) | ||
| const [selectedCredentialData, setSelectedCredentialData] = useState(null) | ||
|
|
||
| const handleCredentialDataChange = useCallback((credData) => { | ||
| setSelectedCredentialData(credData) | ||
| }, []) | ||
| // Use props if provided (for recursive/nested calls), otherwise use local state | ||
| const [selectedCredential, setSelectedCredential] = useState(selectedCredentialProp ?? data.credential ?? null) | ||
| const [selectedCredentialData, setSelectedCredentialData] = useState(selectedCredentialDataProp ?? null) |
There was a problem hiding this comment.
Sync credential props with state in nested NodeInputHandler
Because selectedCredential/selectedCredentialData are initialized from props via useState, updates to the forwarded props after mount are ignored. In the recursive tab case, when a user changes the credential in the parent, the child NodeInputHandler keeps the old state and the GoogleDrivePicker continues using stale credentials. This means nested pickers won’t reflect credential changes unless the child is remounted; consider deriving the value directly from props or syncing via useEffect.
Useful? React with 👍 / 👎.
Summary
Changes
selectedCredential,selectedCredentialData,handleCredentialDataChange) in component signatureTest Plan
ReferenceErrorin browser consoleRelated
🤖 Generated with Claude Code