Skip to content
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

fix(api): Cancel all jobs related to a transactionId from the 'cancel' method #4616

Conversation

scopsy
Copy link
Contributor

@scopsy scopsy commented Oct 22, 2023

What change does this PR introduce?

Why was this change needed?

Closes NV-3019

Other information (Screenshots)

@@ -24,13 +24,13 @@ describe('Trigger event - Delay triggered events - /v1/events/trigger (POST)', f
let standardQueueService: StandardQueueService;
const messageRepository = new MessageRepository();

const triggerEvent = async (payload, transactionId?: string, overrides = {}) => {
const triggerEvent = async (payload, transactionId?: string, overrides = {}, to = [subscriber.subscriberId]) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the ability to test more than 1 subscriber

@@ -342,7 +344,7 @@ describe('Trigger event - Delay triggered events - /v1/events/trigger (POST)', f
content: '',
metadata: {
unit: DigestUnitEnum.SECONDS,
amount: 0.1,
amount: 5,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid flakiness in the test

Comment on lines +10 to +17
const jobs = await this.jobRepository.find(
{
_environmentId: command.environmentId,
transactionId: command.transactionId,
status: JobStatusEnum.DELAYED,
},
'_id'
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will still find only the delay job - as its the only one that has DELAYED status. The others are pending. Or am I missing something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind. Got you. its multiple subscribers

@scopsy scopsy merged commit 494d848 into next Oct 22, 2023
32 of 33 checks passed
@scopsy scopsy deleted the nv-3019-cancel-trigger-api-is-not-cancelling-all-events-related-to branch October 22, 2023 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants