-
Notifications
You must be signed in to change notification settings - Fork 229
feat: Using the AtlasUserData class to demo save user data project COMPASS-9565 #7152
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
base: extend-user-data
Are you sure you want to change the base?
Conversation
options.getResourceUrl, | ||
options.authenticatedFetch, | ||
{ | ||
serialize: (content) => EJSON.stringify(content, undefined, 2), |
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.
This is good for debugging but I'd expect us to use unspaced EJSON in prod
// TODO: verify that this doesn't break anything in compass | ||
const _id = new ObjectId().toHexString(); |
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.
Was there something wrong with UUIDs?
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.
In either case we haven't changed the type, just the string format, is that what we want here? just making sure if we want an ObjectId or UUID to be stored, we shouldn't toString this, we should leave it as the type we want
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.
Is this going to impact existing compass data that does use UUID?
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.
Notes:
- For now we will just make the zod schema support string without the uuid assertion.
- We should consider storing OID directly to keep type information encoded into the format, just need to get zod to agree to that.
- We need to handle migrations of existing compass files (-ish) depending on what relies on
_id
abstract readOne( | ||
id: string, | ||
options?: ReadOptions | ||
): Promise<z.output<T> | undefined>; |
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.
When does this return undefined
? I kinda would've expected this to return a version of ReadAllResult
that either has a single item in the arrays or the properties are one item instead of an array
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.
Identified that readOne
in AtlasUserData should not be returning null
when an error is found. readOne
in FileUserData
originally had a return type of Promise<z.output<T> | undefined>
, so the abstract method should also have type undefined
.
// TODO: verify that this doesn't break anything in compass | ||
const _id = new ObjectId().toHexString(); |
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.
Is this going to impact existing compass data that does use UUID?
Description
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes