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

Add message count limit #3272

Merged
merged 37 commits into from
May 2, 2023
Merged

Add message count limit #3272

merged 37 commits into from
May 2, 2023

Conversation

djabarovgeorge
Copy link
Contributor

What change does this PR introduce?

In this PR we introduce the count limit param.

Why was this change needed?

We need this additional limit query option, in order to reduce the number of scanned objects/returned on MongoDB.

Other information (Screenshots)

@djabarovgeorge djabarovgeorge marked this pull request as ready for review April 23, 2023 14:20
Copy link
Contributor

@LetItRock LetItRock left a comment

Choose a reason for hiding this comment

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

hey, left you a few comments ;) also you forgot to assign the ticket ;)

apps/api/src/app/messages/messages.controller.ts Outdated Show resolved Hide resolved
apps/api/src/app/widgets/pipes/limit-pipe/limit-pipe.ts Outdated Show resolved Hide resolved
apps/api/src/app/widgets/pipes/limit-pipe/limit-pipe.ts Outdated Show resolved Hide resolved
apps/api/src/app/widgets/pipes/limit-pipe/limit-pipe.ts Outdated Show resolved Hide resolved
apps/widget/cypress/plugins/index.ts Outdated Show resolved Hide resolved
Comment on lines 115 to 119
async awaitRunningJobs({ templateId, organizationId }: { templateId: string; organizationId: string }) {
await awaitRunningJobs({ apiKey: config.env.API_URL, templateId, organizationId });

return true;
},
Copy link
Contributor

Choose a reason for hiding this comment

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

you don't need to have this wrapper function, instead assign the default value to the awaitRunningJobs:132, like

async function awaitRunningJobs({
  apiKey = config.env.API_URL,
...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created this one to use it in notifications-list.spec.ts in order to try to solve the flaky tests in the CI. :(

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry what I meant is that you don't have to call awaitRunningJobs in line 116... instead you can do:

 const session = new UserSession(serverUrl);
  await session.awaitRunningJobs(templateId, undefined, 0, organizationId);

like you don't need to have that additional function awaitRunningJobs

@LetItRock LetItRock self-requested a review April 26, 2023 09:00
djabarovgeorge and others added 6 commits April 30, 2023 12:31
# Conflicts:
#	apps/api/src/app/subscribers/subscribers.controller.ts
#	apps/api/src/app/widgets/usecases/get-notifications-feed/get-notifications-feed.usecase.ts
#	apps/api/src/app/widgets/widgets.controller.ts
@djabarovgeorge djabarovgeorge added this pull request to the merge queue May 2, 2023
Merged via the queue into next with commit 21d2aac May 2, 2023
32 of 33 checks passed
@djabarovgeorge djabarovgeorge deleted the add-message-count-limit branch May 2, 2023 11:43
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.

None yet

3 participants