fix: gracefully handle publish lock acquisition (#7687)

This commit is contained in:
Laurin 2026-02-12 12:31:19 +01:00 committed by GitHub
parent 273b12543b
commit c514e237da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
'hive': patch
---
Gracefully handle error when publish lock acquisition fails for clients not supporting retries.

View file

@ -1298,10 +1298,24 @@ export class SchemaPublisher {
},
)
.catch((error: unknown) => {
if (error instanceof MutexResourceLockedError && input.supportsRetry === true) {
if (error instanceof MutexResourceLockedError) {
if (input.supportsRetry === true) {
return {
__typename: 'SchemaPublishRetry',
reason: 'Another schema publish is currently in progress.',
} satisfies PublishResult;
}
return {
__typename: 'SchemaPublishRetry',
reason: 'Another schema publish is currently in progress.',
__typename: 'SchemaPublishError',
valid: false,
changes: [],
errors: [
{
message:
'Another schema publish is currently in progress. Please retry the publish.',
},
],
} satisfies PublishResult;
}