Problem/Motivation
The purpose of removeStaleAlerts() seems to be only removing alerts that are no longer being returned from the endpoint, which makes sense.
However, in practice this function removes all alerts, because the call to .includes() is on the raw endpoint data that is an array of objects. None of theme will match the UUID string being compared.
Steps to reproduce
Turn on automatic refresh of alerts, and create an alert or two. Watch elements get replaced. All will get replaced at the "stale" step.
Proposed resolution
Fix the JavaScript logic to only remove alerts not present in the latest endpoint data.
Issue fork sitewide_alert-3337688
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3337688-removestalealerts-removes-all
changes, plain diff MR !31
Comments
Comment #3
bvoynickOpened an MR with a fix.
Comment #4
bvoynickComment #5
bvoynickComment #8
smustgrave commentedWill include in latest 3.0.x branch!