-
Notifications
You must be signed in to change notification settings - Fork 61
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(j-s): Null Service Reference #15247
Conversation
WalkthroughThe Changes
Sequence DiagramsUpdated Dependency Injection FlowsequenceDiagram
participant Client
participant InternalCaseService
participant PDFService
Client->>+InternalCaseService: Initiate Service
InternalCaseService->>+PDFService: Dependency Injection with @Inject(forwardRef)
Client->>-InternalCaseService: Use Service
This sequence diagram illustrates the updated dependency injection flow where the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Outside diff range and nitpick comments (2)
apps/judicial-system/backend/src/app/modules/case/internalCase.service.ts (2)
Line range hint
832-832
: Consider optimizing the use of spread syntax in accumulators to improve performance.- .then((theCase) => - this.defendantService.createForNewCase( - theCase.id, - { - nationalId: caseToCreate.accusedNationalId, - name: caseToCreate.accusedName, - gender: caseToCreate.accusedGender, - address: (caseToCreate.accusedAddress || '').trim(), - citizenship: caseToCreate.citizenship, - }, - transaction, - ), - ) + .then((theCase) => { + const defendant = { + nationalId: caseToCreate.accusedNationalId, + name: caseToCreate.accusedName, + gender: caseToCreate.accusedGender, + address: (caseToCreate.accusedAddress || '').trim(), + citizenship: caseToCreate.citizenship, + }; + return this.defendantService.createForNewCase(theCase.id, defendant, transaction); + })Tools
Biome
[error] 165-165: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 167-167: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 169-169: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
Line range hint
850-850
: Change to an optional chain to make the code more readable and safe.- if (theCase.appealCaseNumber) { + if (theCase?.appealCaseNumber) {Tools
Biome
[error] 165-165: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 167-167: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 169-169: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- apps/judicial-system/backend/src/app/modules/case/internalCase.service.ts (1 hunks)
Additional context used
Path-based instructions (1)
apps/judicial-system/backend/src/app/modules/case/internalCase.service.ts (1)
Pattern
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
Biome
apps/judicial-system/backend/src/app/modules/case/internalCase.service.ts
[error] 141-141: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 142-142: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 143-143: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 145-145: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 147-147: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 149-149: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 151-151: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 153-153: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 155-155: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 157-157: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 159-159: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 161-161: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 163-163: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 165-165: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 167-167: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 169-169: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 850-850: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
[error] 832-832: Avoid the use of spread (
...
) syntax on accumulators. (lint/performance/noAccumulatingSpread)Spread syntax should be avoided on accumulators (like those in
.reduce
) because it causes a time complexity ofO(n^2)
.
Consider methods such as .splice or .push instead.
Additional comments not posted (1)
apps/judicial-system/backend/src/app/modules/case/internalCase.service.ts (1)
167-167
: The usage of@Inject
decorator here is correctly implemented to resolve the null service reference issue. However, ensurePDFService
is properly initialized before its use in the service methods to avoid runtime errors.Tools
Biome
[error] 167-167: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15247 +/- ##
==========================================
- Coverage 37.10% 37.10% -0.01%
==========================================
Files 6448 6448
Lines 131454 131447 -7
Branches 37574 37566 -8
==========================================
- Hits 48780 48775 -5
+ Misses 82674 82672 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 14 Total Test Services: 0 Failed, 14 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (4) |
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
…15239) * Fix locale updates. Add cleanstring * update string clean * Update packagejson * Update query * Update query * Add lang option * Test * Fix * Add locale * Test name update * fix: force generated files * chore: nx format:write update dirty files * Revert test * Remove ff * fix: hash generated files * fix(j-s): Null Service Reference (#15247) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * feat(native-app): Notifications final improvements (#15240) * feat: buttons at top should not be sticky * feat: add empty state for notifications * fix: make sure to update unreadCount in inbox when fetching next page * feat: add fallback icon for notifications --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * feat(consultation-portal): KAM-2522: PowerBI report added (#15251) * fix: hash generated files (#15253) * fix: hash generated files * chore: nx format:write update dirty files --------- Co-authored-by: andes-it <[email protected]> * fix: remove file * Update __config.mjs --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: lommi <[email protected]> Co-authored-by: andes-it <[email protected]> Co-authored-by: Guðjón Guðjónsson <[email protected]> Co-authored-by: Þórey Jóna <[email protected]> Co-authored-by: Karl Arnar Ægisson <[email protected]>
…15239) * Fix locale updates. Add cleanstring * update string clean * Update packagejson * Update query * Update query * Add lang option * Test * Fix * Add locale * Test name update * fix: force generated files * chore: nx format:write update dirty files * Revert test * Remove ff * fix: hash generated files * fix(j-s): Null Service Reference (#15247) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * feat(native-app): Notifications final improvements (#15240) * feat: buttons at top should not be sticky * feat: add empty state for notifications * fix: make sure to update unreadCount in inbox when fetching next page * feat: add fallback icon for notifications --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * feat(consultation-portal): KAM-2522: PowerBI report added (#15251) * fix: hash generated files (#15253) * fix: hash generated files * chore: nx format:write update dirty files --------- Co-authored-by: andes-it <[email protected]> * fix: remove file * Update __config.mjs --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: lommi <[email protected]> Co-authored-by: andes-it <[email protected]> Co-authored-by: Guðjón Guðjónsson <[email protected]> Co-authored-by: Þórey Jóna <[email protected]> Co-authored-by: Karl Arnar Ægisson <[email protected]>
…15255) * fix(documents-v2): Add download URL to detail document v2 (#15194) * fix(service-portal): Update notification icon styling (#15219) * Update notification icon styling * Add option to remove button docline * fix(service-portal): Notifications - locale updates. Add cleanstring (#15239) * Fix locale updates. Add cleanstring * update string clean * Update packagejson * Update query * Update query * Add lang option * Test * Fix * Add locale * Test name update * fix: force generated files * chore: nx format:write update dirty files * Revert test * Remove ff * fix: hash generated files * fix(j-s): Null Service Reference (#15247) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * feat(native-app): Notifications final improvements (#15240) * feat: buttons at top should not be sticky * feat: add empty state for notifications * fix: make sure to update unreadCount in inbox when fetching next page * feat: add fallback icon for notifications --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * feat(consultation-portal): KAM-2522: PowerBI report added (#15251) * fix: hash generated files (#15253) * fix: hash generated files * chore: nx format:write update dirty files --------- Co-authored-by: andes-it <[email protected]> * fix: remove file * Update __config.mjs --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: lommi <[email protected]> Co-authored-by: andes-it <[email protected]> Co-authored-by: Guðjón Guðjónsson <[email protected]> Co-authored-by: Þórey Jóna <[email protected]> Co-authored-by: Karl Arnar Ægisson <[email protected]> --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: lommi <[email protected]> Co-authored-by: andes-it <[email protected]> Co-authored-by: Guðjón Guðjónsson <[email protected]> Co-authored-by: Þórey Jóna <[email protected]> Co-authored-by: Karl Arnar Ægisson <[email protected]>
Null Service Reference
Laga villur á prod
What
Why
Checklist:
Summary by CodeRabbit