Skip to content
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

Merged
merged 3 commits into from
Dec 14, 2023

Conversation

bcolloran
Copy link
Contributor

@bcolloran bcolloran commented Dec 7, 2023

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!

@bcolloran bcolloran self-assigned this Dec 7, 2023
@bcolloran bcolloran requested a review from djbarnwal December 11, 2023 17:47
Copy link
Member

@djbarnwal djbarnwal left a 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.

Comment on lines 111 to 114
(res.data?.meta?.stateUpdatedOn
? res.data?.meta?.stateUpdatedOn > lastUpdatedOn
: undefined);

Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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 })

@bcolloran bcolloran merged commit f8899cd into main Dec 14, 2023
2 checks passed
@bcolloran bcolloran deleted the svelte-check-ignore-cleanup-5 branch December 14, 2023 19:03
mindspank pushed a commit that referenced this pull request Dec 18, 2023
* fix most of "time-controls" folder

* change default return value to `false`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants