-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tt maintain statuses on workflows #47
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request introduces significant changes to the workflow management system, focusing on maintaining and updating workflow statuses more effectively.
- Added new
WorkflowStatusModule
inworkflow-status.module.ts
to handle status updates and version changes - Introduced
WorkflowStatus
enum inworkflow.workspace-entity.ts
, separating workflow statuses from version statuses - Implemented
WorkflowStatusesUpdateJob
inworkflow-statuses-update.job.ts
to process batch events for workflow version statuses - Refactored
WorkflowTriggerWorkspaceService
inworkflow-trigger.workspace-service.ts
to improve version management and status transitions - Added comprehensive test suite in
workflow-statuses-update.job.spec.ts
to cover various scenarios for status updates
10 file(s) reviewed, 10 comment(s)
Edit PR Review Bot Settings | Greptile
|
||
const WorkflowStatusOptions = [ | ||
{ | ||
value: WorkflowVersionStatus.DRAFT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: WorkflowVersionStatus is used here instead of WorkflowStatus
constructor(private readonly twentyORMManager: TwentyORMManager) {} | ||
|
||
@Process(WorkflowStatusesUpdateJob.name) | ||
async handle(event: WorkflowVersionBatchEvent): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: handle method processes events in parallel using Promise.all, which could lead to race conditions if multiple events affect the same workflow
const statusUpdates = payload.events.filter( | ||
(workflowVersionEvent) => | ||
workflowVersionEvent.previousStatus !== workflowVersionEvent.newStatus, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider adding a type annotation for workflowVersionEvent for better readability
describe('handle', () => { | ||
beforeEach(() => { | ||
// make twentyORMManager.getRepository return a mock object | ||
TwentyORMManager.prototype.getRepository = jest.fn(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: This mock might override the one set in the beforeEach block for the entire describe block. Consider moving it to individual tests if needed.
const currentWorkflowStatuses = workflow.statuses || []; | ||
let newWorkflowStatuses = new Set<WorkflowStatus>(currentWorkflowStatuses); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: initializing newWorkflowStatuses with currentWorkflowStatuses is unnecessary as it's immediately reassigned in the following conditions
if ( | ||
isEqual(newWorkflowStatusesArray.sort(), currentWorkflowStatuses.sort()) | ||
) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: sorting arrays for comparison may be inefficient for large status lists. Consider using a more optimized comparison method
await this.upgradeWorflowVersion( | ||
workflow, | ||
workflowVersion.id, | ||
workflowRepository, | ||
workflowVersionRepository, | ||
manager, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: Typo in method name: 'upgradeWorflowVersion' should be 'upgradeWorkflowVersion'
); | ||
} | ||
|
||
private async hasWorkflowVersionByStatus( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: hasWorkflowVersionByStatus fetches all matching versions. For large datasets, consider using a count query or limit(1) for better performance
const activeWorkflowVersions = await workflowVersionRepository.find( | ||
{ | ||
where: { | ||
workflowId: workflowVersion.workflowId, | ||
status: WorkflowVersionStatus.ACTIVE, | ||
}, | ||
}, | ||
manager, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: This query might be inefficient for large datasets. Consider using a count query instead of fetching all active versions.
this.emitStatusUpdateEventOrThrow( | ||
workflowVersion.workflowId, | ||
workflowVersion.status, | ||
WorkflowVersionStatus.ACTIVE, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Emitting the event before the database transaction is committed could lead to inconsistencies if the transaction fails.
@greptileai can you review this pull request? |
@greptileai can you review this pull request? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
No major changes found since last review.
No file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
@greptileai can you explain what's happening in this pull request? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request introduces several significant changes to the workflow management system. Here's a summary of the key modifications:
-
Method Renaming:
enableWorkflowTrigger
is renamed toactivateWorkflowVersion
disableWorkflowTrigger
is renamed todeactivateWorkflowVersion
These changes make the method names more descriptive and aligned with their functionality.
-
New Workflow Version Status:
- A new status
ARCHIVED
is added to theWorkflowVersionStatus
enum. - This allows for better tracking of workflow version lifecycle.
- A new status
-
Workflow Status Management:
- Introduction of a new
WorkflowStatus
enum and related options. - This helps in managing the overall status of workflows, not just individual versions.
- Introduction of a new
-
Event Listeners and Job Processing:
- New event listeners are added for workflow version creation, status updates, and deletion.
- A new job
WorkflowStatusesUpdateJob
is introduced to handle these events asynchronously. - This improves the system's ability to react to changes in workflow versions and update statuses accordingly.
-
Workflow Activation Logic:
- The process of activating a workflow version is refactored and expanded.
- It now includes steps like upgrading the workflow version, setting statuses, and enabling triggers.
-
Error Handling and Validation:
- Additional checks and error handling are implemented to ensure data integrity and prevent invalid state transitions.
-
Module Updates:
- The
WorkflowStatusModule
is added to theWorkflowModule
, integrating the new status management features.
- The
-
Testing:
- New tests are added for the
WorkflowStatusesUpdateJob
to ensure proper functionality of the status update logic.
- New tests are added for the
These changes enhance the workflow management system by providing more granular control over workflow versions, improving status tracking, and ensuring that status changes are properly propagated and handled throughout the system.
@greptileai pls help me!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes you've made involve renaming and refactoring some methods related to workflow version activation and deactivation, as well as adding a new status 'ARCHIVED' for workflow versions. Here's a summary of the key changes:
-
Method renaming:
enableWorkflowTrigger
is nowactivateWorkflowVersion
disableWorkflowTrigger
is nowdeactivateWorkflowVersion
-
New WorkflowVersionStatus:
- Added 'ARCHIVED' status to the WorkflowVersionStatus enum
-
New WorkflowStatus enum:
- Introduced a separate enum for workflow statuses (DRAFT, ACTIVE, DEACTIVATED)
-
Workflow status updates:
- Added a new job (WorkflowStatusesUpdateJob) to handle batch updates of workflow statuses
- Implemented a listener (WorkflowVersionStatusListener) to trigger the status update job
-
Refactoring:
- Split the activation and deactivation logic into smaller, more focused methods
- Added more granular error handling and status checks
-
New module:
- Added WorkflowStatusModule to handle the new status update functionality
These changes aim to improve the workflow management system by providing more precise control over workflow version statuses and ensuring that the overall workflow status is updated accordingly. The new job and listener system allows for more efficient batch processing of status updates.
Is there anything specific about these changes you'd like me to explain further?
@greptileai skibidi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request continues to refine the workflow management system, focusing on improving error handling and status transitions.
- Enhanced error handling in
workflow-trigger.workspace-service.ts
for invalid workflow version transitions - Added
WorkflowVersionTransitionError
inerrors.ts
for more specific error reporting - Implemented additional checks in
activateWorkflowVersion
method to prevent invalid status transitions - Updated
deactivateWorkflowVersion
method to handle ARCHIVED status correctly - Refined status update logic in
WorkflowStatusesUpdateJob
to ensure consistent workflow statuses
No file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
@greptileai what's up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request further refines the workflow management system, focusing on error handling and status transition improvements.
- Introduced
WorkflowVersionTransitionError
inerrors.ts
for more specific error reporting in invalid transitions - Enhanced
activateWorkflowVersion
inworkflow-trigger.workspace-service.ts
with additional checks to prevent invalid status transitions - Updated
deactivateWorkflowVersion
to properly handle the ARCHIVED status - Refined status update logic in
WorkflowStatusesUpdateJob
to maintain consistent workflow statuses across versions
No file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
@greptileai please help |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request continues to refine the workflow management system, focusing on improving error handling and status transitions for workflow versions.
- Introduced
WorkflowVersionTransitionError
inerrors.ts
for more specific error reporting during invalid transitions - Enhanced
activateWorkflowVersion
method with additional checks to prevent invalid status transitions - Updated
deactivateWorkflowVersion
method to properly handle the ARCHIVED status - Refined status update logic in
WorkflowStatusesUpdateJob
to maintain consistent workflow statuses across versions
No file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This update enhances the workflow status management system with improved error handling and validation.
- Added validation logic in
getValidWorkflowVersionOrFail
to separate concerns from database operations - Implemented batch processing in
WorkflowVersionStatusListener
to efficiently handle multiple status updates - Enhanced error handling in
workflow-trigger.workspace-service.ts
with transaction management for database operations - Updated method names in
workflow-trigger.resolver.ts
for better semantic clarity (e.g.,activateWorkflowVersion
) - Added test coverage in
workflow-statuses-update.job.spec.ts
for status transition scenarios
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
10 file(s) reviewed, 13 comment(s)
Edit PR Review Bot Settings | Greptile
|
||
const WorkflowStatusOptions = [ | ||
{ | ||
value: WorkflowVersionStatus.DRAFT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: WorkflowVersionStatus.DRAFT is used here but should be WorkflowStatus.DRAFT to match the new enum
@Module({ | ||
providers: [WorkflowStatusesUpdateJob, WorkflowVersionStatusListener], | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Module does not export its providers, which may prevent other modules from injecting WorkflowStatusesUpdateJob or WorkflowVersionStatusListener. Consider adding exports array if these services need to be used outside this module.
color: 'yellow', | ||
}, | ||
{ | ||
value: WorkflowVersionStatus.ACTIVE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: WorkflowVersionStatus.ACTIVE is used here but should be WorkflowStatus.ACTIVE to match the new enum
import { WorkflowStatusesUpdateJob } from 'src/modules/workflow/workflow-status/jobs/workflow-statuses-update.job'; | ||
import { WorkflowVersionStatusListener } from 'src/modules/workflow/workflow-status/listeners/workflow-version-status.listener'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Using absolute imports with 'src/' can cause issues in production builds. Consider using relative imports or configuring path aliases properly.
color: 'green', | ||
}, | ||
{ | ||
value: WorkflowVersionStatus.DEACTIVATED, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: WorkflowVersionStatus.DEACTIVATED is used here but should be WorkflowStatus.DEACTIVATED to match the new enum
describe('handle', () => { | ||
beforeEach(() => { | ||
// make twentyORMManager.getRepository return a mock object | ||
TwentyORMManager.prototype.getRepository = jest.fn(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: mocking TwentyORMManager.prototype.getRepository is unnecessary since mockTwentyORMManager is already injected
Omit<WorkflowVersionWorkspaceEntity, 'trigger'> & { | ||
trigger: WorkflowTrigger; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: return type could be simplified to WorkflowVersionWorkspaceEntity & { trigger: NonNullable<WorkflowTrigger> }
for better type safety
expect(mockWorkflowRepository.update).toHaveBeenCalledTimes(0); | ||
}); | ||
|
||
it('when no draft yet, update statuses', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: missing assertion to verify the actual status values being updated to in the repository call
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [ | ||
WorkflowStatusesUpdateJob, | ||
{ | ||
provide: TwentyORMManager, | ||
useValue: mockTwentyORMManager, | ||
}, | ||
], | ||
}).compile(); | ||
|
||
job = await module.resolve<WorkflowStatusesUpdateJob>( | ||
WorkflowStatusesUpdateJob, | ||
); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: reset mock call history in beforeEach to ensure clean state between tests
const workflow = await workflowRepository.findOneOrFail({ | ||
where: { | ||
id: workflowId, | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: findOneOrFail will throw an exception if the workflow is not found. Consider handling this error gracefully with a custom exception that includes the workflowId for better debugging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request further refines the workflow management system, focusing on improving error handling and status transitions.
- Implemented transaction management in
workflow-trigger.workspace-service.ts
for atomic database operations during workflow version activation and deactivation - Added
emitStatusUpdateEventOrThrow
method to ensure consistent status update event emission - Refined
WorkflowStatusesUpdateJob
to handle edge cases in status transitions, such as deactivation of non-active versions - Updated
WorkflowVersionStatusListener
to filter and process events more efficiently, reducing unnecessary processing
10 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
import { WorkflowStatusesUpdateJob } from 'src/modules/workflow/workflow-status/jobs/workflow-statuses-update.job'; | ||
import { WorkflowVersionStatusListener } from 'src/modules/workflow/workflow-status/listeners/workflow-version-status.listener'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: consider using relative imports instead of absolute paths for better maintainability
const workflowIds = payload.events | ||
.filter( | ||
(event) => | ||
!event.properties.after.status || | ||
event.properties.after.status === WorkflowVersionStatus.DRAFT, | ||
) | ||
.map((event) => event.properties.after.workflowId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: consider using Set for unique workflowIds
const workflowIds = payload.events | ||
.filter( | ||
(event) => | ||
event.properties.before.status === WorkflowVersionStatus.DRAFT, | ||
) | ||
.map((event) => event.properties.before.workflowId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: consider using Set for unique workflowIds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request continues to enhance the workflow management system, focusing on improving transaction handling and event processing. Key updates include:
- Implemented robust transaction management in
workflow-trigger.workspace-service.ts
for atomic database operations - Added
emitStatusUpdateEventOrThrow
method inworkflow-trigger.workspace-service.ts
for consistent status update event emission - Refined
WorkflowStatusesUpdateJob
to handle edge cases in status transitions more effectively - Optimized
WorkflowVersionStatusListener
for more efficient event filtering and processing
10 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request further refines the workflow management system, focusing on transaction handling and event processing efficiency.
- Implemented robust transaction management in
workflow-trigger.workspace-service.ts
for atomic database operations during workflow version activation and deactivation - Added
emitStatusUpdateEventOrThrow
method inworkflow-trigger.workspace-service.ts
to ensure consistent status update event emission - Optimized
WorkflowVersionStatusListener
inworkflow-version-status.listener.ts
for more efficient event filtering and batch processing - Refined error handling in
workflow-trigger.workspace-service.ts
with specific exceptions for invalid workflow version transitions
10 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
expect(mockWorkflowRepository.update).toHaveBeenCalledTimes(0); | ||
}); | ||
|
||
it('when no draft yet, update statuses', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: This test doesn't verify the actual update content. Consider adding an expectation for the update call arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request continues to refine the workflow management system, focusing on improving transaction handling and error management. Key updates include:
- Enhanced transaction management in
workflow-trigger.workspace-service.ts
for atomic operations during workflow version activation and deactivation - Implemented
emitStatusUpdateEventOrThrow
method inworkflow-trigger.workspace-service.ts
to ensure consistent status update event emission - Improved error handling with specific exceptions for invalid workflow version transitions in
workflow-trigger.workspace-service.ts
- Optimized
WorkflowVersionStatusListener
inworkflow-version-status.listener.ts
for more efficient event filtering and batch processing
10 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
this.workspaceEventEmitter.emit( | ||
'workflowVersion.statusUpdated', | ||
[ | ||
{ | ||
workflowId, | ||
previousStatus, | ||
newStatus, | ||
} satisfies WorkflowVersionStatusUpdate, | ||
], | ||
workspaceId, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Event emission is not awaited, which could lead to race conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This update enhances the workflow status management system with improved validation and error handling.
- Added
getValidWorkflowVersionOrFail
inworkflow-common.workspace-service.ts
to separate validation logic from database operations - Implemented transaction rollback in
workflow-trigger.workspace-service.ts
for failed workflow version activations - Added specific error codes in
workflow-trigger.exception.ts
for invalid workflow version transitions - Enhanced test coverage in
workflow-statuses-update.job.spec.ts
for edge cases like concurrent status updates
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
10 file(s) reviewed, 9 comment(s)
Edit PR Review Bot Settings | Greptile
|
||
const WorkflowStatusOptions = [ | ||
{ | ||
value: WorkflowVersionStatus.DRAFT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Using WorkflowVersionStatus.DRAFT instead of WorkflowStatus.DRAFT - this will cause type mismatches and runtime errors
import { WorkflowVersionStatusListener } from 'src/modules/workflow/workflow-status/listeners/workflow-version-status.listener'; | ||
|
||
@Module({ | ||
providers: [WorkflowStatusesUpdateJob, WorkflowVersionStatusListener], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: MessageQueueService is used in WorkflowVersionStatusListener but not imported/provided here. Add MessageQueueService to providers or imports.
import { WorkflowVersionStatusListener } from 'src/modules/workflow/workflow-status/listeners/workflow-version-status.listener'; | ||
|
||
@Module({ | ||
providers: [WorkflowStatusesUpdateJob, WorkflowVersionStatusListener], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: TwentyORMManager is used in WorkflowStatusesUpdateJob but not imported/provided here. Add TwentyORMManager to providers or imports.
const workflowIds = payload.events | ||
.filter( | ||
(event) => | ||
event.properties.before.status === WorkflowVersionStatus.DRAFT, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: only handling deletion of DRAFT status versions could miss cleanup needed for other statuses
expect(mockWorkflowRepository.update).toHaveBeenCalledTimes(0); | ||
}); | ||
|
||
it('when no draft yet, update statuses', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Missing assertion for the actual update values in this test. Should verify the new statuses array contains both ACTIVE and DRAFT
export class WorkflowStatusesUpdateJob { | ||
constructor(private readonly twentyORMManager: TwentyORMManager) {} | ||
|
||
@Process(WorkflowStatusesUpdateJob.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: no error handling in the main handle method - failed promises in Promise.all() could cause partial updates
|
||
const workflowVersion = await workflowVersionRepository.findOne({ | ||
await this.upgradeWorflowVersion( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: typo in method name 'upgradeWorflowVersion' (missing 'k')
this.emitStatusUpdateEventOrThrow( | ||
workflowVersion.workflowId, | ||
workflowVersion.status, | ||
WorkflowVersionStatus.DEACTIVATED, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: status update event is emitted with the old status when it should be using the new DEACTIVATED status
const activeWorkflowVersions = await workflowVersionRepository.find( | ||
{ | ||
where: { | ||
workflowId: workflowVersion.workflowId, | ||
status: WorkflowVersionStatus.ACTIVE, | ||
}, | ||
}, | ||
manager, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: race condition possible between checking active versions and setting new active version
No description provided.