Skip to content
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/missing user #4472

Merged
merged 4 commits into from
Aug 21, 2024
Merged

Fix/missing user #4472

merged 4 commits into from
Aug 21, 2024

Conversation

motechFR
Copy link
Contributor

@motechFR motechFR commented Aug 21, 2024

WHAT

Reliably ensure we upsert farcaster user in the form

WHY

updatedBy: userId,
userId: member.userId,
// This is necessary because some test data fids do not have a corresponding farcaster profile
name: member.name || '',
farcasterId: member.farcasterId
name: member.account.displayName || member.account.username,
Copy link
Member

@mattcasey mattcasey Aug 21, 2024

Choose a reason for hiding this comment

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

@motechFR please trim these values, this wouldn't fix the name which we got, which was was " "

import { getFarcasterUsers } from '@root/lib/farcaster/getFarcasterUsers';
import { uid } from '@root/lib/utils/strings';
import { isTruthy } from '@root/lib/utils/types';
import { meanBy } from 'lodash';
Copy link
Member

Choose a reason for hiding this comment

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

accidental import?

)
).filter(isTruthy);
const projectMembers = await Promise.all(
newProjectMembers.map(async (member) => ensureFarcasterUserExists({ fid: member.farcasterId }))
Copy link
Member

@mattcasey mattcasey Aug 21, 2024

Choose a reason for hiding this comment

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

async is uneccessary

Copy link
Member

@mattcasey mattcasey left a comment

Choose a reason for hiding this comment

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

look sgood but please address whitespace usernames

@motechFR motechFR merged commit de5cc3c into main Aug 21, 2024
5 checks passed
@motechFR motechFR deleted the fix/missing-user branch August 21, 2024 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants