-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat: change limit to 100 from 1000 #3631
feat: change limit to 100 from 1000 #3631
Conversation
NV-2161 [v0.16] Update the count query to 100 in the API
Why? (Context)In the current scope, in order to reduce the amount of the examined and returned documents from MongoDB we will update the API to 100 in our system with API query, but leave the default for other API users to 1000. What?This task Score:
I hope I found all the places that will be required to update in the code, I flagged them with this task number "NV-2161" so you may search for it so it will be easy to find. |
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.
Would love to sync about it as well, tried the coffee time so we get Dima as well but i am not sure if will make it 😅
apps/api/src/app/widgets/usecases/get-notifications-feed/get-notifications-feed.usecase.ts
Outdated
Show resolved
Hide resolved
apps/api/src/app/messages/usecases/get-messages/get-messages.usecase.ts
Outdated
Show resolved
Hide resolved
fe9b0f3
to
cbd9b87
Compare
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.
Looks good left a couple of comments there.
apps/api/src/app/widgets/usecases/get-notifications-feed/get-notifications-feed.usecase.ts
Show resolved
Hide resolved
apps/api/src/app/messages/usecases/get-messages/get-messages.usecase.ts
Outdated
Show resolved
Hide resolved
@@ -91,7 +91,7 @@ export class MessageRepository extends BaseRepository<MessageDBModel, MessageEnt | |||
subscriberId: string, | |||
channel: ChannelTypeEnum, | |||
query: { feedId?: string[]; seen?: boolean; read?: boolean } = {}, | |||
options: { limit: number } = { limit: 1000 } // todo NV-2161 update to 100 in version 0.16 | |||
options: { limit: number; skip?: number } = { limit: 100, skip: 0 } |
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.
We need to start to centralise these in shared constants so we avoid to miss them when updating. One for the tech debt.
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.
Yeah looks good, left a couple of comments on there regarding things i was not sure about.
apps/api/src/app/widgets/usecases/get-notifications-feed/get-notifications-feed.usecase.ts
Outdated
Show resolved
Hide resolved
apps/api/src/app/widgets/usecases/get-notifications-feed/get-notifications-feed.usecase.ts
Outdated
Show resolved
Hide resolved
apps/api/src/app/widgets/usecases/get-notifications-feed/get-notifications-feed.usecase.ts
Show resolved
Hide resolved
…otifications-feed.usecase.ts Co-authored-by: George Djabarov <39195835+djabarovgeorge@users.noreply.github.com>
Pull reviewers statsStats of the last 30 days for novu:
|
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.
Just the bit of code that looks off. The limit for a tech debt.
@@ -16,8 +16,7 @@ export class GetFeedCountCommand extends EnvironmentWithSubscriber { | |||
@IsOptional() | |||
@Transform(({ value }) => { | |||
if (isNaN(value) || value == null) { | |||
// todo NV-2161 update the limit default to 100 to in version 0.16 | |||
return 1000; | |||
return 100; |
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.
We should centralize the selected values and reduce the hardcodes. 🙏🏻
apps/api/src/app/widgets/usecases/get-notifications-feed/get-notifications-feed.usecase.ts
Outdated
Show resolved
Hide resolved
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.
🌟
What change does this PR introduce?
Change limit from 100 to 1000 for notification center usage
Why was this change needed?
To reduce load added from the notification center requests