fix(core): Update cached project association when moving a workflow (#19227)

This commit is contained in:
Charlie Kolb
2025-09-05 12:04:41 +02:00
committed by GitHub
parent b713c503d6
commit c5bbb6a96f
2 changed files with 12 additions and 1 deletions

View File

@@ -94,6 +94,14 @@ export class OwnershipService {
return sharedWorkflow.project; return sharedWorkflow.project;
} }
async setWorkflowProjectCacheEntry(workflowId: string, project: Project): Promise<Project> {
void this.cacheService.setHash('workflow-project', {
[workflowId]: this.copyProject(project),
});
return project;
}
/** /**
* Retrieve the user who owns the personal project, or `null` if non-personal project. * Retrieve the user who owns the personal project, or `null` if non-personal project.
* Personal project ownership is **immutable**. * Personal project ownership is **immutable**.

View File

@@ -344,7 +344,10 @@ export class EnterpriseWorkflowService {
// @ts-ignore CAT-957 // @ts-ignore CAT-957
await this.workflowRepository.update({ id: workflow.id }, { parentFolder }); await this.workflowRepository.update({ id: workflow.id }, { parentFolder });
// 10. try to activate it again if it was active // 10. Update potential cached project association
await this.ownershipService.setWorkflowProjectCacheEntry(workflow.id, destinationProject);
// 11. try to activate it again if it was active
if (wasActive) { if (wasActive) {
return await this.attemptWorkflowReactivation(workflowId); return await this.attemptWorkflowReactivation(workflowId);
} }