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.

Command icon 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:

Comments

bvoynick created an issue. See original summary.

bvoynick’s picture

Opened an MR with a fix.

bvoynick’s picture

Status: Active » Needs review
bvoynick’s picture

Assigned: bvoynick » Unassigned

  • smustgrave committed b406d14a on 3.0.x
    Issue #3337688 by bvoynick: removeStaleAlerts() always removes all...
smustgrave’s picture

Version: 2.x-dev » 3.0.x-dev
Status: Needs review » Fixed

Will include in latest 3.0.x branch!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.