-
Notifications
You must be signed in to change notification settings - Fork 478
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
Fleet UI: Fix policy software automation fail to report as failing #26044
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #26044 +/- ##
=======================================
Coverage 63.64% 63.64%
=======================================
Files 1631 1631
Lines 156293 156293
Branches 4088 4088
=======================================
Hits 99471 99471
Misses 48984 48984
Partials 7838 7838
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
hey @jacobshandling any chance you can take a minute today to review this? ☀️ |
const responses: Promise< | ||
ReturnType<typeof teamPoliciesAPI.update> | ||
>[] = []; | ||
responses.concat( |
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.
Aha, concat doesn't mutate the array itself!
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.
Would directly assigning responses like this also do the trick?
const responses = changedPolicies.map((changedPolicy) => {
return teamPoliciesAPI.update(changedPolicy.id, {
// "software_title_id": null will unset software install for the policy
// "software_title_id": X will set the value to the given integer (except 0).
software_title_id: changedPolicy.swIdToInstall || null,
team_id: teamIdForApi,
});
});
software_title_id: changedPolicy.swIdToInstall || null, | ||
team_id: teamIdForApi, | ||
}) | ||
.catch((error) => { |
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.
Did you confirm that one error doesn't prevent the rest of the calls from being cancelled?
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.
It'd be nice to avoid combining try..catch...
and .catch
syntax if possible, is there a way to do this with just try/catch?
Issue
For #25637
Description
Checklist for submitter
If some of the following don't apply, delete the relevant line.
changes/
,orbit/changes/
oree/fleetd-chrome/changes
.