Skip to content
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

Alerts - fix bug when severity null #4614

Merged
merged 1 commit into from
Sep 7, 2018
Merged

Alerts - fix bug when severity null #4614

merged 1 commit into from
Sep 7, 2018

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Sep 6, 2018

Monitor > Alerts > Overview

the code going through all the alerts can handle severity being undefined
but that never happens, since it comes from the server as null :)

this leads to an ugly error in the console when opnening Monitor > Alerts > Overview (and nothing showing up)

fixed - any falsy value is wrong and will be rewritten to info now

the code going through all the alerts can handle severity being undefined
but that never happens, since it comes from the server as null :)

this leads to an ugly error in the console when opnening Monitor > Alerts > Overview (and nothing showing up)

fixed - any falsy value is wrong and will be rewritten to `info` now
@himdel
Copy link
Contributor Author

himdel commented Sep 6, 2018

The bug on master:

angular.self-f52e962…a54.js?body=1:14962 TypeError: Cannot read property 'push' of undefined
    at alerts_center_servic…f6a0d.js?body=1:673
    at Object.forEach (angular.self-f52e962…27a54.js?body=1:419)
    at alertsCenterService._this.convertToAlertsOverview (alerts_center_servic…f6a0d.js?body=1:586)
    at processData (alerts_overview_cont…9dffb.js?body=1:235)
    at processQueue (angular.self-f52e962…a54.js?body=1:17331)
    at angular.self-f52e962…a54.js?body=1:17379
    at Scope.$digest (angular.self-f52e962…a54.js?body=1:18516)
    at angular.self-f52e962…a54.js?body=1:18836
    at completeOutstandingRequest (angular.self-f52e962…7a54.js?body=1:6440)
    at angular.self-f52e962…7a54.js?body=1:6719 "Possibly unhandled rejection: {}"

@himdel
Copy link
Contributor Author

himdel commented Sep 6, 2018

And this is the alert causing the failure:

{
  acknowledged: null,
  assignee_id: null,
  description: "ec2-cloudwatch-max-cpu",
  ems_id: "38",
  evaluated_on: "2018-02-18T01:16:35Z",
  event_ems_ref: null,
  href: "http://localhost:3000/api/alerts/18",
  id: "18",
  miq_alert_id: "30",
  resolved: null,
  resource: {id: "1945", vendor: "amazon", format: null, version: null, name: "demo-ssh-bastion",},
  resource_id: "1945",
  resource_type: "VmOrTemplate",
  result: false,
  severity: null,
  url: null,
}

@miq-bot
Copy link
Member

miq-bot commented Sep 6, 2018

Checked commit https://github.com/himdel/manageiq-ui-classic/commit/c0629f829aae853532fda105272d49b4c1cd3476 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. 🏆

@mzazrivec mzazrivec self-assigned this Sep 7, 2018
@mzazrivec mzazrivec added this to the Sprint 94 Ending Sep 10, 2018 milestone Sep 7, 2018
@mzazrivec mzazrivec merged commit 20ca67b into ManageIQ:master Sep 7, 2018
@mzazrivec
Copy link
Contributor

@himdel is this gaprindashvili/yes ?

@himdel himdel deleted the alerts-fix branch September 7, 2018 08:19
@himdel
Copy link
Contributor Author

himdel commented Sep 7, 2018

Actually, no, it seems it's not needed there..

The code was there from the start - #507
What changed was ManageIQ/manageiq-api#253 - before that, null attributes would be removed by the API, so this would end up as undefined.
(and that one never made it to gaprindashvili)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants