CuBoulder / express_mono

Monolithic Express Profile - contains all bundles
GNU General Public License v2.0
1 stars 2 forks source link

RAVE alerts add check for "[CLEAR]" token #842

Closed AlanBCole closed 2 years ago

AlanBCole commented 3 years ago

Recent changes to the rave_alerts module fixed the issue we had with rave_alerts occasionally breaking web express sites but it changed the workflow for the people who manage the alerts.

this issue:

  1. determine the previous and desired workflow based around adding the [CLEAR] token to alert titles
  2. study the previous state of the code around that token's use
  3. reimplement it in a way that preserves the fix
AlanBCole commented 3 years ago

Previously the rave title token check flow was as follows:

  1. set rave_alerts_display to 1 (truthy)
  2. if [ACTIVE] token is in the title:
    • rave_alerts_active_event to 1
    • log 'ACTIVE token found'
  3. if [CLEAR] token is in the title:
    • set rave_alerts_display to 0
    • set rave_alerts_active_event to 0
    • no logging of this event

The effect is that if no [CLEAR] token is found in the title an alert will display because the rave_alerts_display variable is set outside of the conditional logic. However the only way to log anything was to include the [ACTIVE] token.