-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
fi: support uuid -> username mapping #290
Conversation
fix: update gql types
@zichongkao any idea why end-to-end tests are failing? |
Basically in openbeta-graphql/src/utils/testUtils.ts Line 26 in 2589e6b
jwt.verify 's return value and the return value has no scope field. I made the middleware robust to not having scope . But in future, I'm sure we'll have to mock scope in the mocked response so that we can give isBuilder status for testing out user profile stuff.
|
I'll review the PR later this evening! |
I pulled your fix down. API tests are still failing inside
The response object:
|
That's a bit surprising. They pass locally and on the automated checks. Is your .env in a good state? On my end, I don't see anything that is trying to connect to port 80. |
You're right. I have a |
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.
Looks good in general! I can see how adding username resolvers will help reduce frontend API calls in many places.
Many of the questions I raised are for my own learning.
The one product decision that might be worth discussing is whether to make usernames mandatory during sign-up. I'm leaning toward yes, especially since they are mutable so users can revisit them later if they don't like them. Otherwise the power of defaults is strong and users may just leave the auto-generated ones.
expect(response.statusCode).toBe(200) | ||
const areaResult = response.body.data.area | ||
expect(areaResult.uuid).toBe(muuidToString(wa.metadata.area_id)) | ||
expect(areaResult.organizations.length).toBe(1) | ||
expect(areaResult.organizations).toHaveLength(1) |
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.
Thanks for fixing this!
}, { | ||
_id: false, | ||
timestamps: { | ||
updatedAt: true, |
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.
Slightly confused too, since below we type this as a "NotUpdatableField", so how come we allow an updatedAt
time?
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.
Ok I understand now why we allow updatedAt
. But still wondering why we list as a "NotUpdatableField".
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.
updatedAt: true
: Mongo will set the value for you whenever there's an update
*Edit: in this case I simply want Mongo to create the updatedAt field for me. We want to set username update timestamp ourselves, but don't want API users to do it.
Issue #202
Incrementally move user profile data to our own db. The goal of this PR is to support syncing username from Auth0 to our db to enable mapping from user uuid to username.