-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Staging #6130
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
Staging #6130
Conversation
* chore: syncloanspolaris improved * chore: validator added on loans and savings * refactor: refactor code * refactor: refactor code * refactor: refactor code
* chore: syncloanspolaris improved * chore: validator added on loans and savings * refactor: refactor code * refactor: refactor code * refactor: refactor code * feat: savings transaction first commit * feat: savings transaction sync commit2 * feat: income deposit added * refactor: refactor code * refactor: refactor code * refactor: refactor code * refactor: refactor code * chore: create loan with polaris date * feat: loan give transactin added * refactor: refactor code * chore: peyment transaction add * feat: saving & deposit income add * feat: deposit and loans some imrpvement
Reviewer's guide (collapsed on small PRs)Reviewer's GuideConverted field cleaning methods to asynchronous Promises with proper awaiting and error propagation, and removed debug logging in product import and Customers modules. Sequence diagram for asynchronous field cleaning and error propagationsequenceDiagram
participant "Caller (e.g. Customer or Product Import)"
participant "Fields Model"
"Caller (e.g. Customer or Product Import)"->>"Fields Model": await clean(_id, value)
alt Success
"Fields Model"-->>"Caller (e.g. Customer or Product Import)": cleaned value (Promise resolved)
else Error
"Fields Model"-->>"Caller (e.g. Customer or Product Import)": throw Error (Promise rejected)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Caution Review failedThe pull request is closed. π Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro π Files selected for processing (3)
β¨ Finishing Touches
π§ͺ Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Hey there - I've reviewed your changes - here's some feedback:
- The result of await this.clean isnβt assigned back to fieldValue, so the cleaning has no effectβmake sure to reassign the cleaned value.
- Switching from logging and continue to throwing on clean errors changes semanticsβconfirm if you really want to block on the first clean failure.
- Rethrowing with new Error(e.message) loses the original stack; consider rethrowing or wrapping the original error to preserve context.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The result of await this.clean isnβt assigned back to fieldValue, so the cleaning has no effectβmake sure to reassign the cleaned value.
- Switching from logging and continue to throwing on clean errors changes semanticsβconfirm if you really want to block on the first clean failure.
- Rethrowing with new Error(e.message) loses the original stack; consider rethrowing or wrapping the original error to preserve context.Help me be more useful! Please click π or π on each comment and I'll use the feedback to improve your reviews.
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.
Important
Looks good to me! π
Reviewed everything up to 0472c43 in 1 minute and 31 seconds. Click for details.
- Reviewed
81lines of code in3files - Skipped
0files when reviewing. - Skipped posting
3draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with π or π to teach Ellipsis.
1. packages/core/src/data/modules/product/imports.ts:72
- Draft comment:
Possible typo: the code pushes to 'doc.customFieldsData' but then passes 'doc.customFieldData' (singular) to prepareCustomFieldsData. Likely should use 'doc.customFieldsData'. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. packages/core/src/db/models/Fields.ts:267
- Draft comment:
Added 'await' before this.clean(key, value) ensures async execution. Confirm that sequential awaits (vs parallel) are intentional for performance. - Reason this comment was not posted:
Comment looked like it was already resolved.
3. packages/core/src/db/models/Fields.ts:470
- Draft comment:
Replacing the log-and-continue with a thrown error in the cleanup of custom fields changes error handling. Confirm that aborting on a clean failure is intended. - Reason this comment was not posted:
Comment looked like it was already resolved.
Workflow ID: wflow_eqFjzVaCo9Ert6jt
You can customize by changing your verbosity settings, reacting with π or π, replying to comments, or adding code review rules.
|
Summary by Sourcery
Make field cleaning operations asynchronous and improve error handling, while removing leftover debug logging
Enhancements:
Chores:
Important
Remove console logs and update
cleanfunctions to return promises for consistency inimports.ts,Customers.ts, andFields.ts.console.logstatements fromimports.tsandCustomers.ts.clean()andcleanMulti()inFields.tsto return promises for consistency in asynchronous handling.loadFieldClassto useawaitwithclean()inFields.ts.This description was created by
for 0472c43. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
Bug Fixes
Chores