Skip to content

Commit 16709f2

Browse files
sir-sigurdclaude
andauthored
Fix 'Error resolving revision' flash after package creation (#4778)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ce52cf2 commit 16709f2

2 files changed

Lines changed: 33 additions & 34 deletions

File tree

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+
- [Fixed] Fix "Error resolving revision" flash when navigating to a just-created package ([#4778](https://github.com/quiltdata/quilt/pull/4778))
2122
- [Changed] Qurator: Switch to Claude Sonnet 4.5, add `quratorDefaultModel` config field for per-stack model override ([#4764](https://github.com/quiltdata/quilt/pull/4764))
2223
- [Fixed] Fix crash when deleting a role on the admin page ([#4751](https://github.com/quiltdata/quilt/pull/4751))
2324
- [Fixed] Fix presigned S3 URLs using wrong region for cross-bucket package files, causing download and preview failures ([#4742](https://github.com/quiltdata/quilt/pull/4742))

catalog/app/containers/Bucket/PackageTree/PackageTree.tsx

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,43 +1170,41 @@ function PackageTreeQueries({
11701170
resolvedFrom,
11711171
mode,
11721172
}: PackageTreeQueriesProps) {
1173-
const {
1174-
fetching,
1175-
error,
1176-
data: revisionData,
1177-
} = GQL.useQuery(REVISION_QUERY, { bucket, name, hashOrTag })
1173+
const revisionQuery = GQL.useQuery(REVISION_QUERY, { bucket, name, hashOrTag })
11781174
const revisionListQuery = GQL.useQuery(REVISION_LIST_QUERY, { bucket, name })
11791175
const displayError = React.useMemo(() => errors.displayError(), [])
11801176

1181-
if (fetching) return <Placeholder color="text.secondary" />
1182-
if (error) return <>{displayError(error)}</>
1183-
1184-
if (!revisionData?.package) {
1185-
return (
1186-
<Message headline="No Such Package">
1187-
Package named{' '}
1188-
<M.Box component="span" fontWeight="fontWeightMedium">{`"${name}"`}</M.Box> could
1189-
not be found in this bucket.
1190-
</Message>
1191-
)
1192-
}
1193-
1194-
return (
1195-
<Selection.Provider>
1196-
<PackageTree
1197-
{...{
1198-
bucket,
1199-
name,
1200-
hashOrTag,
1201-
revision: revisionData.package.revision,
1202-
path,
1203-
mode,
1204-
resolvedFrom,
1205-
revisionListQuery,
1206-
}}
1207-
/>
1208-
</Selection.Provider>
1209-
)
1177+
return GQL.fold(revisionQuery, {
1178+
fetching: () => <Placeholder color="text.secondary" />,
1179+
error: (error) => <>{displayError(error)}</>,
1180+
data: (revisionData) => {
1181+
if (!revisionData.package) {
1182+
return (
1183+
<Message headline="No Such Package">
1184+
Package named{' '}
1185+
<M.Box component="span" fontWeight="fontWeightMedium">{`"${name}"`}</M.Box>{' '}
1186+
could not be found in this bucket.
1187+
</Message>
1188+
)
1189+
}
1190+
return (
1191+
<Selection.Provider>
1192+
<PackageTree
1193+
{...{
1194+
bucket,
1195+
name,
1196+
hashOrTag,
1197+
revision: revisionData.package.revision,
1198+
path,
1199+
mode,
1200+
resolvedFrom,
1201+
revisionListQuery,
1202+
}}
1203+
/>
1204+
</Selection.Provider>
1205+
)
1206+
},
1207+
})
12101208
}
12111209

12121210
interface PackageTreeRouteParams {

0 commit comments

Comments
 (0)