Add isUnique update in query + invalidate cache on rollback (#19746)
Fix isUnique not sent in field update mutation: Added isUnique and settings to the Pick type in useUpdateOneFieldMetadataItem, which previously silently dropped these properties from the GraphQL payload. Invalidate cache on failed migration rollback: Added invalidateCache() call in the migration runner's catch block so that a failed migration (e.g., unique index creation failing due to duplicate data) regenerates the Redis hash, preventing stale metadata from persisting in frontend localStorage indefinitely. Was
This commit is contained in:
+2
@@ -43,10 +43,12 @@ export const useUpdateOneFieldMetadataItem = () => {
|
||||
| 'description'
|
||||
| 'icon'
|
||||
| 'isActive'
|
||||
| 'isUnique'
|
||||
| 'label'
|
||||
| 'name'
|
||||
| 'defaultValue'
|
||||
| 'options'
|
||||
| 'settings'
|
||||
| 'isLabelSyncedWithName'
|
||||
>;
|
||||
}): Promise<
|
||||
|
||||
+12
@@ -288,6 +288,18 @@ export class WorkspaceMigrationRunnerService {
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
await this.invalidateCache({
|
||||
allFlatEntityMapsKeys,
|
||||
workspaceId,
|
||||
});
|
||||
} catch (cacheError) {
|
||||
this.logger.error(
|
||||
`Cache invalidation failed after rollback: ${cacheError}`,
|
||||
'Runner',
|
||||
);
|
||||
}
|
||||
|
||||
if (error instanceof WorkspaceMigrationRunnerException) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user