-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
Add test for weird cases #1532
Add test for weird cases #1532
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 |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
* id: int|string|null, | ||
* name?: string|null, | ||
* enabled: boolean, | ||
* position: int|null, | ||
* position: int|string|null, | ||
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. It didn't followed the whole but since you're doing a is numeric check, should it be 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. numeric-string is more restrictive than string. IMO we should try to see if the string is numeric, so we cast it, or is not numeric, so we not setPosition. |
||
* settings: array<string, mixed>, | ||
* type: string|null, | ||
* created_at: int|null, | ||
|
@@ -32,7 +32,7 @@ | |
* id: int|string|null, | ||
* name?: string|null, | ||
* enabled: boolean, | ||
* position: int|null, | ||
* position: int|string|null, | ||
* settings: array<string, mixed>, | ||
* type: string|null, | ||
* created_at: int|null, | ||
|
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.
Should we throw an exception when it's set but not a numeric ?
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.
Not sure TBH, old snapshot data, if it is not easily fixable, might contains some weird data.
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.
For now I would go for the , let's try to see what data can get on the snapshot content and fix all the errors. Later we might want to provide a command to fix snapshots, or fix snapshots on the fly while being loaded. Not sure right now, but at a first step, I would prefer to not throw a lot of exceptions on old data.
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 sure. I think you can just cast to int everytime and it's ok for me