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

more strictNullChecks #3729

Merged
merged 26 commits into from
Dec 21, 2023
Merged

more strictNullChecks #3729

merged 26 commits into from
Dec 21, 2023

Conversation

bcolloran
Copy link
Contributor

part of #3373

@@ -119,7 +119,7 @@ export function createSchemaForTable(
) as ReturnType<typeof createConnectorServiceOLAPGetTable>;
}

export function resourceIsLoading(resource: V1Resource) {
export function resourceIsLoading(resource?: V1Resource) {
Copy link
Contributor Author

@bcolloran bcolloran Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already checks for undefined input right below, the function just wasn't typed correctly

@bcolloran bcolloran self-assigned this Dec 20, 2023
@bcolloran
Copy link
Contributor Author

@ericpgreen2 , picked off strictNullChecks in sources!

overlay.set({ title: `Importing ${tableName}.yaml` });
await saveAndRefresh(tableName, $sourceStore.clientYAML);
checkSourceImported(queryClient, sourceName, filePath);
overlay.set(null);
};

const onRefreshClick = async (tableName: string) => {
// no-op if connector is undefined
if (connector === undefined) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to above. If connector is undefined, can we instead disable the Button so this code path is never hit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can disable the button, but we can't take out this check because of the way the component is set up. In practice, I think this code path will never actually be hit anyway. This whole thing is ugly anyway (see eg the try/catch with a no-op directly below) and could use a refactor, but I'm gonna make the call that that's out of scope for this PR

Copy link
Contributor

@ericpgreen2 ericpgreen2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a variety of comments, but will approve and you can address as you see fit

@bcolloran bcolloran merged commit 3faab09 into main Dec 21, 2023
4 checks passed
@bcolloran bcolloran deleted the strictNullChecks-3 branch December 21, 2023 20:49
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.

2 participants