8000 fix: Pick latest connected account in get_connection() method by abhishekpatil4 · Pull Request #1569 · ComposioHQ/composio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: Pick latest connected account in get_connection() method #1569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking &ldquo 8000 ;Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abhishekpatil4
Copy link
Contributor
@abhishekpatil4 abhishekpatil4 commented Apr 24, 2025

Sweep Summary Sweep

Fixed the get_connection() method in the Composio SDK client to correctly select the latest connected account by taking the first matching account instead of comparing creation dates.

  • S 8000 implified the logic in python/composio/client/__init__.py by removing the datetime comparison and using the first matching account as the latest one.
  • Removed unnecessary code that was incorrectly comparing creation dates (it was actually selecting the oldest account, not the latest).
  • Added a break statement to exit the loop once a matching account is found, improving performance.

Ask Sweep AI questions about this PR

  • Fixed the logic in get_connection() method to get the latest connected account ID

Copy link
vercel bot commented Apr 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
composio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2025 5:59pm

Copy link
Contributor

LGTM 👍

Comment on lines +345 to +346
latest_account = connected_account
break
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need to sort the list of connected account by the creation date in reverse fir this logic to work

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.

3 participants
0