Skip to content

Commit

Permalink
[dagit] Repair issue where last ten runs are missing for job (#8305)
Browse files Browse the repository at this point in the history
  • Loading branch information
hellendag committed Jun 9, 2022
1 parent 3f55bd2 commit e61fc61
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,12 @@ export const InstanceOverviewPage = () => {
}, [bucketed, visibleRepos, searchValue]);

const lastTenRunsFlattened = React.useMemo(() => {
if (!lastTenRunsData) {
if (lastTenRunsLoading || !lastTenRunsData) {
return null;
}

const flattened: {[key: string]: RunTimeFragment[]} = {};
if (!lastTenRunsLoading && lastTenRunsData?.workspaceOrError.__typename === 'Workspace') {
if (lastTenRunsData.workspaceOrError.__typename === 'Workspace') {
for (const locationEntry of lastTenRunsData.workspaceOrError.locationEntries) {
if (
locationEntry.__typename === 'WorkspaceLocationEntry' &&
Expand Down Expand Up @@ -243,7 +243,7 @@ export const InstanceOverviewPage = () => {
const appendRuns = (jobItem: JobItem) => {
const {job, repoAddress} = jobItem;
const jobKey = makeJobKey(repoAddress, job.name);
const matchingRuns = lastTenRunsFlattened ? lastTenRunsFlattened[jobKey] : [];
const matchingRuns = lastTenRunsFlattened ? lastTenRunsFlattened[jobKey] || [] : [];
return {...jobItem, runs: [...matchingRuns].reverse()};
};

Expand Down

0 comments on commit e61fc61

Please sign in to comment.