Bug #35894
Foreman.settings.load_values is not able to pick settings which transitioned from a non-default to default value
Description
When a setting is set back to its default value, the value persisted in DB is `nil` to denominate that the default value should be used. However, the setting registry only looks at settings with non-nil values so it never picks up the nondefault->default transition.
Steps to reproduce:
1) Run rails console
2) Pick a $setting without custom value
3) Read a value of $setting with Setting[$setting]
4) In another process, change the value of $setting to a non-default one
5) Reload the settings with Foreman.settings.load_values
6) Repeat 3, notice the value is what was set in 4
6) In another process, change the value of $setting to the default one
7) Repeat 5
8) Repeat 3
Actual results:
The value in 8 is the same as in 6
Expected results:
The value in 8 is the same as in 3
Associated revisions
History
#1
Updated by Adam Ruzicka 3 months ago
- Bugzilla link set to 2157869
#2
Updated by The Foreman Bot 3 months ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/9570 added
#3
Updated by The Foreman Bot 3 months ago
- Fixed in Releases 3.6.0 added
#4
Updated by Adam Ruzicka 3 months ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman|acafe1aae2eef439a73334635046dfb79be55894.
#5
Updated by Maria Agaphontzev 2 months ago
- Target version set to 3.5.2
#6
Updated by Ewoud Kohl van Wijngaarden about 1 month ago
- Triaged changed from No to Yes
#7
Updated by The Foreman Bot 20 days ago
- Fixed in Releases 3.5.2 added
Fixes #35894 - Properly detect setting changes
Previously we missed setting changes which changed a setting back to its
default value.