-
Notifications
You must be signed in to change notification settings - Fork 158
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
Memo schema tests #253
Memo schema tests #253
Conversation
readonly id: string; | ||
readonly question: Record<string, unknown>[]; | ||
readonly answer: Record<string, unknown>[]; | ||
readonly uniqueId: string; |
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.
Just to point that I personally prefer id
over uniqueId
as I said when we were developing Flutter client, but we need to create a standard. Or everything becomes id
or uniqueId
. We already have uniqueId
set as the property in the flutter models and collections json's
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.
Yeah, and that's why I've created all of these structures using id
, and not uniqueId
. What needs to be updated are the collections, and not our current structures. uniqueId
made sense where collections were stored locally and shared a unique id amongst all of them, even though they didn't belong to the same collection.
Given that, you can rollback to id
no problem.
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.
But should we update the collections jsons and also Flutter model to use id as well? Otherwise we'll use id
in the server and uniqueId
in the client. I highlight what I've said back in the client development that id
implicitly means that's an unique identifier IMO, that's no reason to emphasis the unique
stuff.
PS: We would need this minor refactoring in a separate PR instead mixing with this one stuff
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.
Tests looking good!
readonly id: string; | ||
readonly question: Record<string, unknown>[]; | ||
readonly answer: Record<string, unknown>[]; | ||
readonly uniqueId: string; |
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.
Yeah, and that's why I've created all of these structures using id
, and not uniqueId
. What needs to be updated are the collections, and not our current structures. uniqueId
made sense where collections were stored locally and shared a unique id amongst all of them, even though they didn't belong to the same collection.
Given that, you can rollback to id
no problem.
} | ||
|
||
const memoContentValidationSchema = Joi.object({ |
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.
const memoContentValidationSchema = Joi.object({ | |
const memoQuillValidationSchema = Joi.object({ |
Just to enforce where we are taking these from. I think being specific here is beneficial.
Maybe also add a succinct doc?
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.
Just to enforce where we are taking these from. I think being specific here is beneficial.
But aren't we going to follow the same format when we develop our own editor in #223? If yes, I don't see why would we enforce quill
in the name here, since we plan to remove it in the near future
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.
If we're going to create a custom format, it'll probably use quill deltas anyways, as it's a pretty solid and well-tested approach. Creating a brand new complex-object serialization + data-format is too much work. All available editors, if I'm not mistaken, use quill (i.e zefyr and flutter-quill).
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.
Renamed
0f0ee7b
to
bf72afe
Compare
bf72afe
to
f0c6eba
Compare
5826536
to
99f15a6
Compare
ef3186b
to
f964d5b
Compare
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.
But should we update the collections jsons and also Flutter model to use id as well? Otherwise we'll use id in the server and uniqueId in the client. I highlight what I've said back in the client development that id implicitly means that's a unique identifier IMO, that's no reason to emphasis the unique stuff.
PS: We would need this minor refactoring in a separate PR instead mixing with this one stuff
I don't quite follow what you meant with "collections jsons", but yes, everything needs to be id
since when we opted to update the strategy to use sub-collections of non-conflicting id's of these memos. The client will be eventually updated when the referencing models are mapped from firestore, as it's now mapping from flutter's assets folder + sembast local database.
} | ||
|
||
const memoContentValidationSchema = Joi.object({ |
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.
If we're going to create a custom format, it'll probably use quill deltas anyways, as it's a pretty solid and well-tested approach. Creating a brand new complex-object serialization + data-format is too much work. All available editors, if I'm not mistaken, use quill (i.e zefyr and flutter-quill).
42bbf70
to
e95dbf9
Compare
f964d5b
to
177582e
Compare
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.
Lgtm
No description provided.