Bug #21026
Notification not cleared when there is no other discovered host
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1488998
Description of problem:
No notification regarding Discovery Host should be visible when there is no one available (see screenshot).
How reproducible:
Always
Steps to Reproduce:
1. Create a Discovery Host
2. Delete the Discovery Host
Actual results:
There is a notifications regarding discovery host even in its absence.
Expected results:
No notifications regarding discovery host.
Associated revisions
History
#1
Updated by Sebastian Gräßl over 3 years ago
- Subject changed from Notification not cleared when there is not discovered host to Notification not cleared when there is not discovered host
- Assignee set to Sebastian Gräßl
#2
Updated by Sebastian Gräßl over 3 years ago
- Project changed from Discovery to Foreman
- Subject changed from Notification not cleared when there is not discovered host to Notification not cleared when there is no other discovered host
- Category set to Notifications
#3
Updated by The Foreman Bot over 3 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/4861 added
#4
Updated by Tomer Brisker about 3 years ago
- Legacy Backlogs Release (now unused) set to 296
#5
Updated by Ohad Levy about 3 years ago
Tomer - I would suggest 1.16 instead - any concerns?
#6
Updated by Anonymous about 3 years ago
- % Done changed from 0 to 100
- Status changed from Ready For Testing to Closed
Applied in changeset 6d6adc3ab07a3811c132a7e7f716569b5bca4cf3.
Fixes #21026 - Clear cached notifications properly
Using `delete_all` for has_many does not trigger callbacks
on the associated objects, `dependent: :destroy` does.
Clearing the cache needs to happen anytime a notification
gets created, modified and destroyed, `after_commit`
will be triggered on all o these occasions.