-
Notifications
You must be signed in to change notification settings - Fork 40
fix: fix promise bug when save adjustments #5875
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: fix promise bug when save adjustments #5875
Conversation
Signed-off-by: yuda <yuda@megazone.com>
Signed-off-by: yuda <yuda@megazone.com>
Signed-off-by: yuda <yuda@megazone.com>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
|
@yuda110 is attempting to deploy a commit to the cloudforet Team on Vercel. A member of the Team first needs to authorize it. |
|
🎉 @seungyeoneeee has been randomly selected as the reviewer! Please review. 🙏 |
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.
Pull Request Overview
This PR fixes a promise bug when saving adjustments by updating API sort parameters and refining update logic.
- Changed sort order from "created_at" (ascending) to "order" (descending) in the adjustment policy query.
- Enhanced update functions in the AdvancedSettings overlay by checking for differences before updating and using Promise.all for concurrency.
- Updated the adjustment iteration logic and success messaging to leverage internationalized text and a helper function.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/web/src/services/cost-explorer/composables/queries/use-report-adjustment-policy-query.ts | Updates the API helper sort field and direction to sort by "order" descending |
| apps/web/src/services/cost-explorer/components/AdvancedSettingsSetAdjustmentsOverlay.vue | Refactors update methods with pre-checks for difference, replaces forEach with Promise.all for concurrent operations, and revises the adjustment iteration logic |
Comments suppressed due to low confidence (1)
apps/web/src/services/cost-explorer/components/AdvancedSettingsSetAdjustmentsOverlay.vue:227
- Mapping over formPolicies to process adjustments may inadvertently omit adjustments that do not have a corresponding policy. Consider iterating directly over formAdjustments or ensuring that all adjustments are captured.
await Promise.all(formPolicies.value.map(async (policy) => {
piggggggggy
left a 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.
lgtm!
* fix: fix promise bug when save adjustments Signed-off-by: yuda <yuda@megazone.com> * chore: sort with order Signed-off-by: yuda <yuda@megazone.com> * chore: do not raise api when there's no change Signed-off-by: yuda <yuda@megazone.com> --------- Signed-off-by: yuda <yuda@megazone.com>
* fix: fix promise bug when save adjustments Signed-off-by: yuda <yuda@megazone.com> * chore: sort with order Signed-off-by: yuda <yuda@megazone.com> * chore: do not raise api when there's no change Signed-off-by: yuda <yuda@megazone.com> --------- Signed-off-by: yuda <yuda@megazone.com>
* fix: fix promise bug when save adjustments Signed-off-by: yuda <yuda@megazone.com> * chore: sort with order Signed-off-by: yuda <yuda@megazone.com> * chore: do not raise api when there's no change Signed-off-by: yuda <yuda@megazone.com> --------- Signed-off-by: yuda <yuda@megazone.com>
Skip Review (optional)
style,chore,ci,test,docs)Description (optional)
Things to Talk About (optional)