-
Notifications
You must be signed in to change notification settings - Fork 124
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
svletecheck --ignore cleanup: fix most of "time-controls" folder #3651
Conversation
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 the PR. Looks good for most of the changes. I am not sure what are implications of changed
as undefined
. Approving for all the other changes.
(res.data?.meta?.stateUpdatedOn | ||
? res.data?.meta?.stateUpdatedOn > lastUpdatedOn | ||
: 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.
Not sure if we want to use undefined
here. @ericpgreen2 would have more context.
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.
I'm not so familiar with this code (more @AdityaHegde), but it looks like it's fine as long as we protect against accessing an undefined
attribute. And it looks like @bcolloran is doing so on line 154. After a quick look, line 154-155 is the only place where I see this changed
attribute being used.
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.
good catch @djbarnwal, thank you. The current code is
!lastUpdatedOn || res.data?.meta?.stateUpdatedOn > lastUpdatedOn
, and res.data?.meta?.stateUpdatedOn
is string | undefined
. Since undefined > x => false
for all x: string
, we should default to false here.
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 that said we also return undefined for changed
from this function on line 107 right above this: return { status: ResourceStatus.Busy }
)
* fix most of "time-controls" folder * change default return value to `false`
part of #3424
@djbarnwal -- assigning this review to you since you've worked on this stuff recently (I've also assigned #3678 to you to wrap this folder up). Thanks!