-
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
fix(application-generic): potential get preferences performance improvement #7467
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,9 +1,8 @@ | ||||||
import { merge } from 'lodash'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For 100% manual tree shaking
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahh yeah missed that |
||||||
import { PreferencesTypeEnum } from '@novu/shared'; | ||||||
import { PreferencesEntity } from '@novu/dal'; | ||||||
import { deepMerge } from '../../utils'; | ||||||
|
||||||
import { GetPreferencesResponseDto } from '../get-preferences'; | ||||||
import { MergePreferencesCommand } from './merge-preferences.command'; | ||||||
import { DeepRequired } from '../../http/utils.types'; | ||||||
|
||||||
/** | ||||||
* Merge preferences for a subscriber. | ||||||
|
@@ -44,9 +43,7 @@ export class MergePreferences { | |||||
...(isWorkflowPreferenceReadonly ? [] : subscriberPreferences), | ||||||
]; | ||||||
|
||||||
const mergedPreferences = deepMerge( | ||||||
preferencesList as DeepRequired<PreferencesEntity>[], | ||||||
); | ||||||
const mergedPreferences = merge({}, ...preferencesList); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We assume that the potential issue of slow response times could be that we used the custom |
||||||
|
||||||
// Build the source object | ||||||
const source = { | ||||||
|
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.
all I did in this file is moved the code parts to the class functions to be able to instrument them and see the perf bottleneck