Skip to content

Fix for broadcast messages not staying dismissed

Ross Byrne requested to merge 438595-hiding-broadcast-messages-fix into master

What does this MR do and why?

Resolves #438595 (closed)

Fix for broadcast messages not staying dismissed. In some scenarios (https in SM instance), the cookie used to keep broadcast messages dismissed get cleared by the browsers. This change also persists the dismissal in the DB.

I decided to keep the cookie to allow existing messages to stay dismissed and to save checking the db.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

No visible change

How to set up and validate locally

Reproduce Bug

  1. Checkout master
  2. Follow steps to setup https locally for gdk
  3. Create a broadcast message (URL /admin/broadcast_messages)
  4. Dismiss it
  5. Logout and back in again
  6. See the broadcast message again because the cookie was cleared

Verify Fix

  1. Checkout this branch or copy diff with curl https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151056/diff.diff | git apply
  2. Enable feature flag: echo "Feature.enable :new_broadcast_message_dismissal" | gdk rails c
  3. Make a new broadcast message
  4. Dismiss message
  5. Logout and back in again
  6. See verify the broadcast message is still dismissed

Related to #438595 (closed)

Edited by Ross Byrne

Merge request reports