Skip to content

Commit 87189d8

Browse files
committed
Merge branch 'handle-search-timeout' into qurator-more-devtools
* handle-search-timeout: move comment cl Revert "deploy" deploy display search timeout errors handle search operation errors WIP adjust gql queries, regen sync gql schema
2 parents 6dea616 + 40815b7 commit 87189d8

39 files changed

+499
-53
lines changed

catalog/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ where verb is one of
1818

1919
## Changes
2020

21+
- [Changed] Adjust GQL schema for the upstream changes and handle search timeouts ([#4477](https://github.com/quiltdata/quilt/pull/4477))
2122
- [Fixed] Correctly sign and proxy S3 requests and URIs in OPEN mode ([#4470](https://github.com/quiltdata/quilt/pull/4470))
2223
- [Fixed] Show "0 packages" when no packages ([#4473](https://github.com/quiltdata/quilt/pull/4473))
2324
- [Changed] Search: handle invalid numbers gracefully ([#4468](https://github.com/quiltdata/quilt/pull/4468))

catalog/app/containers/Bucket/Overview/Header.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ function useStats(bucket: string, overviewUrl?: string | null) {
313313
case 'EmptySearchResultSet':
314314
return formatQuantity(0)
315315
case 'InvalidInput':
316+
case 'OperationError':
316317
return '?'
317318
case 'PackagesSearchResultSet':
318319
// `-1` == secure search

catalog/app/containers/Bucket/Overview/gql/StatCounts.generated.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export type containers_Bucket_Overview_gql_StatCountsQuery = {
2323
>
2424
>
2525
})
26+
| ({ readonly __typename: 'OperationError' } & Pick<
27+
Types.OperationError,
28+
'name' | 'message' | 'context'
29+
>)
2630
readonly searchObjects:
2731
| ({ readonly __typename: 'ObjectsSearchResultSet' } & Pick<
2832
Types.ObjectsSearchResultSet,
@@ -37,6 +41,10 @@ export type containers_Bucket_Overview_gql_StatCountsQuery = {
3741
>
3842
>
3943
})
44+
| ({ readonly __typename: 'OperationError' } & Pick<
45+
Types.OperationError,
46+
'name' | 'message' | 'context'
47+
>)
4048
}
4149

4250
export const containers_Bucket_Overview_gql_StatCountsDocument = {
@@ -114,6 +122,21 @@ export const containers_Bucket_Overview_gql_StatCountsDocument = {
114122
],
115123
},
116124
},
125+
{
126+
kind: 'InlineFragment',
127+
typeCondition: {
128+
kind: 'NamedType',
129+
name: { kind: 'Name', value: 'OperationError' },
130+
},
131+
selectionSet: {
132+
kind: 'SelectionSet',
133+
selections: [
134+
{ kind: 'Field', name: { kind: 'Name', value: 'name' } },
135+
{ kind: 'Field', name: { kind: 'Name', value: 'message' } },
136+
{ kind: 'Field', name: { kind: 'Name', value: 'context' } },
137+
],
138+
},
139+
},
117140
],
118141
},
119142
},
@@ -169,6 +192,21 @@ export const containers_Bucket_Overview_gql_StatCountsDocument = {
169192
],
170193
},
171194
},
195+
{
196+
kind: 'InlineFragment',
197+
typeCondition: {
198+
kind: 'NamedType',
199+
name: { kind: 'Name', value: 'OperationError' },
200+
},
201+
selectionSet: {
202+
kind: 'SelectionSet',
203+
selections: [
204+
{ kind: 'Field', name: { kind: 'Name', value: 'name' } },
205+
{ kind: 'Field', name: { kind: 'Name', value: 'message' } },
206+
{ kind: 'Field', name: { kind: 'Name', value: 'context' } },
207+
],
208+
},
209+
},
172210
],
173211
},
174212
},

catalog/app/containers/Bucket/Overview/gql/StatCounts.graphql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ query ($buckets: [String!]) {
1212
context
1313
}
1414
}
15+
... on OperationError {
16+
name
17+
message
18+
context
19+
}
1520
}
1621
searchObjects(buckets: $buckets) {
1722
__typename
@@ -26,5 +31,10 @@ query ($buckets: [String!]) {
2631
context
2732
}
2833
}
34+
... on OperationError {
35+
name
36+
message
37+
context
38+
}
2939
}
3040
}

catalog/app/containers/Bucket/Workflows/Detail.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ function Packages({ bucket, workflow }: PackagesProps) {
150150
)
151151
case 'InvalidInput':
152152
return <M.Typography>Error: Invalid input</M.Typography>
153+
case 'OperationError':
154+
return <M.Typography>{d.searchPackages.message}</M.Typography>
153155
default:
154156
return Eff.absurd<never>(d.searchPackages)
155157
}

catalog/app/containers/Bucket/Workflows/List.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@ function PackagesLink({ bucket, workflow }: PackagesLinkProps) {
6161
</RR.Link>
6262
)
6363
case 'InvalidInput':
64+
case 'OperationError':
65+
const tip =
66+
r.__typename === 'OperationError'
67+
? r.name
68+
: `Invalid input: ${r.errors[0].message}`
6469
return (
65-
<M.Tooltip arrow title={`Invalid input: ${r.errors[0].message}`}>
70+
<M.Tooltip arrow title={tip}>
6671
<span className={classes.root}>? packages</span>
6772
</M.Tooltip>
6873
)

catalog/app/containers/Bucket/Workflows/gql/WorkflowPackageCount.generated.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ export type containers_Bucket_Workflows_gql_WorkflowPackageCountQuery = {
2525
>
2626
>
2727
})
28+
| ({ readonly __typename: 'OperationError' } & Pick<
29+
Types.OperationError,
30+
'name' | 'message' | 'context'
31+
>)
2832
}
2933

3034
export const containers_Bucket_Workflows_gql_WorkflowPackageCountDocument = {
@@ -129,6 +133,21 @@ export const containers_Bucket_Workflows_gql_WorkflowPackageCountDocument = {
129133
],
130134
},
131135
},
136+
{
137+
kind: 'InlineFragment',
138+
typeCondition: {
139+
kind: 'NamedType',
140+
name: { kind: 'Name', value: 'OperationError' },
141+
},
142+
selectionSet: {
143+
kind: 'SelectionSet',
144+
selections: [
145+
{ kind: 'Field', name: { kind: 'Name', value: 'name' } },
146+
{ kind: 'Field', name: { kind: 'Name', value: 'message' } },
147+
{ kind: 'Field', name: { kind: 'Name', value: 'context' } },
148+
],
149+
},
150+
},
132151
],
133152
},
134153
},

catalog/app/containers/Bucket/Workflows/gql/WorkflowPackageCount.graphql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ query ($buckets: [String!]!, $filter: PackagesSearchFilter!) {
1212
context
1313
}
1414
}
15+
... on OperationError {
16+
name
17+
message
18+
context
19+
}
1520
}
1621
}

catalog/app/containers/Bucket/Workflows/gql/WorkflowPackages.generated.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export type containers_Bucket_Workflows_gql_WorkflowPackagesQuery = {
4141
>
4242
>
4343
})
44+
| ({ readonly __typename: 'OperationError' } & Pick<
45+
Types.OperationError,
46+
'name' | 'message' | 'context'
47+
>)
4448
}
4549

4650
export const containers_Bucket_Workflows_gql_WorkflowPackagesDocument = {
@@ -209,6 +213,21 @@ export const containers_Bucket_Workflows_gql_WorkflowPackagesDocument = {
209213
],
210214
},
211215
},
216+
{
217+
kind: 'InlineFragment',
218+
typeCondition: {
219+
kind: 'NamedType',
220+
name: { kind: 'Name', value: 'OperationError' },
221+
},
222+
selectionSet: {
223+
kind: 'SelectionSet',
224+
selections: [
225+
{ kind: 'Field', name: { kind: 'Name', value: 'name' } },
226+
{ kind: 'Field', name: { kind: 'Name', value: 'message' } },
227+
{ kind: 'Field', name: { kind: 'Name', value: 'context' } },
228+
],
229+
},
230+
},
212231
],
213232
},
214233
},

catalog/app/containers/Bucket/Workflows/gql/WorkflowPackages.graphql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,10 @@ query ($buckets: [String!]!, $filter: PackagesSearchFilter!) {
2626
context
2727
}
2828
}
29+
... on OperationError {
30+
name
31+
message
32+
context
33+
}
2934
}
3035
}

0 commit comments

Comments
 (0)