-
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): National registry lookup in indictments #14894
Conversation
WalkthroughThe recent update to the Changes
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 (
|
Datadog ReportAll test runs ✅ 3 Total Test Services: 0 Failed, 3 Passed Test Services
|
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
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- apps/judicial-system/web/src/routes/Prosecutor/components/DefendantInfo/DefendantInfo.tsx (2 hunks)
Additional Context Used
Path-based Instructions (1)
apps/judicial-system/web/src/routes/Prosecutor/components/DefendantInfo/DefendantInfo.tsx (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."
Additional comments not posted (2)
apps/judicial-system/web/src/routes/Prosecutor/components/DefendantInfo/DefendantInfo.tsx (2)
113-115
: Ensure theuseEffect
dependencies are correctly optimized.The update to the dependencies array of this
useEffect
hook to include only[personData, personError]
is aligned with the PR's objective to prevent unnecessary re-renders and potential infinite loops. This change should effectively limit the hook's execution to relevant changes, improving performance and stability.
138-140
: Confirm the effectiveness of the dependency array update.Similar to the previous
useEffect
, updating the dependencies array to[businessData, businessError]
for this hook is a prudent change. It ensures that the hook only runs when there are changes to the business data or errors, which is essential for preventing performance issues and aligns with the best practices for optimizinguseEffect
usage in React.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14894 +/- ##
=======================================
Coverage 37.04% 37.04%
=======================================
Files 6331 6331
Lines 129125 129125
Branches 36858 36858
=======================================
Hits 47832 47832
Misses 81293 81293
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
National registry lookup in indictments
Asana
What
Fix an infinite loop bug when performing a national registry lookup in indictments. This infinite loop happens because we have a function in a parent component that calls
setAndSendCaseToServer
. This means that the function is not memoized and is regenerated on every render.This function is sent, as a prop, down to a child component that executes this function in a
useEffect
, with the function in the dependency array. This causes an infinite loop. The solution is to remove the function from the dependency array.Checklist:
Summary by CodeRabbit