go-frontend
go-frontend copied to clipboard
[PROD] "Child" emergencies show in search when creating a new field report
Issue
When creating a new field report and using the search box to find an existing emergency page to link to, the dropdown of emergencies that show up includes emergency pages that have been merged to other ones, i.e. "child" emergency pages that do not show up anywhere else on the frontend as they have been linked to a "parent" emergency.
Steps to reproduce
Go to https://go.ifrc.org/reports/new and type e.g. "Belgium" in the box to find existing emergency pages. A list like below shows up:
Only the one "parent" emergency however shows up when viewing "All emergencies" for Belgium (expected behaviour):
Expected behaviour
The "child" emergencies should not appear in search on the frontend.
Related feature
#1010 Elastic search
Impact
This mostly impacts some countries in the Europe region as those are the ones that I've done the most gardening for using the merge emergencies feature (and I don't think there have been many others using this feature).
Severity
As the "child" emergency pages do not exist on the frontend anymore otherwise, if a user links a field report to such page, this information is essentially lost. This kind of erroneous linking may also easily go unnoticed.
Is there a workaround?
If users happen to realize to link to the "correct"/master COVID emergency page, this is not a problem, although it is confusing to see the emergency pages that have been "gardened away" show up on the list. A way to avoid this problem without addressing the underlying issue would be to go and delete all the child emergency pages but that would mean some manual work.
I don't know if there have been some changes to search that have made this issue appear because if I recall correctly this wasn't a problem before, some months ago when testing the "Merge emergencies" functionality.
@GregoryHorvath assigning this to you, but happy to look at it together - we some-how need to remove "child" emergencies from the search index?
@teklal Deployed the fixes to staging and ran a reindexing, so now:
- child Emergencies should not show up by default
- if you change an Emergency so it has a parent it should now disappear from the search - or - the other way around if you remove the parent Emergency from one
xref other search tickets https://github.com/IFRCGo/go-frontend/issues/989 and https://github.com/IFRCGo/go-frontend/issues/1353