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

miqDBBackupService - fix isModelValueNil to handle undefined #2377

Merged
merged 1 commit into from
Oct 13, 2017
Merged

miqDBBackupService - fix isModelValueNil to handle undefined #2377

merged 1 commit into from
Oct 13, 2017

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Oct 12, 2017

Go to 👤 > Configuration > Diagnostics > (current server) -> Collect Logs; Edit

Change type to something other than No Depot.

You'll get an Infinite $digest Loop warning in the browser console without this.


isModelValueNil is supposed to return true for all nil-like values (but not 0 or false)

dbRequired tests that to see if the depot_name is actually required
.. but depot_name is using dbRequired to see if the field should be required or not

setting depot_name to an empty string will change the model value to undefined
and there's a watch that changes it to null

=> The value would oscilate between undefined and null, never settling, resulting in an infinite $digest Loop.

This adds undefined to isModelValueNil, causing the value to always settle.

https://bugzilla.redhat.com/show_bug.cgi?id=1498088
https://bugzilla.redhat.com/show_bug.cgi?id=1498097

Cc @mzazrivec

`isModelValueNil` is supposed to return true for all nil-like values (but not 0 or false)

`dbRequired` tests that to see if the depot_name is actually required
.. but `depot_name` is using `dbRequired` to see if the field should be required or not

setting `depot_name` to an empty string will change the model value to `undefined`
and there's a watch that changes it to `null`

=> The value would oscilate between `undefined` and `null`, never settling, resulting in an infinite $digest Loop.

This adds `undefined` to `isModelValueNil`, causing the value to always settle.

https://bugzilla.redhat.com/show_bug.cgi?id=1498088
https://bugzilla.redhat.com/show_bug.cgi?id=1498097
@miq-bot
Copy link
Member

miq-bot commented Oct 12, 2017

Checked commit https://github.com/himdel/manageiq-ui-classic/commit/647426d5e5a95099cfc778aa0055f4fe12ef991a with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
0 files checked, 0 offenses detected
Everything looks fine. 🍪

@mzazrivec mzazrivec added this to the Sprint 71 Ending Oct 16, 2017 milestone Oct 13, 2017
@mzazrivec mzazrivec merged commit 30e331f into ManageIQ:master Oct 13, 2017
@himdel himdel deleted the log-depot-digest-fix branch October 13, 2017 10:21
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