-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 “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
fix: connected account bugfix #1365
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -342,7 +342,7 @@ def get_connection( | |||||
creation_date = datetime.fromisoformat( | ||||||
connected_account.createdAt.replace("Z", "+00:00") | ||||||
) | ||||||
if latest_account is None or creation_date > latest_creation_date: | ||||||
if latest_account is None or creation_date < latest_creation_date: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable names There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding a clarifying comment above this line to explain the logic: # Find the earliest connected account based on creation date This will help future developers understand the intention of this comparison. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The condition is reversed. Using '<' here will select the oldest account, not the latest. For the intended behavior, it should be 'creation_date > latest_creation_date'.
Suggested change
|
||||||
latest_creation_date = creation_date | ||||||
latest_account = connected_account | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for finding the latest account is incorrect - using
<
will return the oldest account instead of newest. Should use>
to get most recentcreation_date
.📝 Committable Code Suggestion