Fix for broadcast messages not staying dismissed
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
- Checkout master
- Follow steps to setup https locally for gdk
- Create a broadcast message (URL
/admin/broadcast_messages
) - Dismiss it
- Logout and back in again
- See the broadcast message again because the cookie was cleared
Verify Fix
- Checkout this branch or copy diff with
curl https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151056/diff.diff | git apply
- Enable feature flag:
echo "Feature.enable :new_broadcast_message_dismissal" | gdk rails c
- Make a new broadcast message
- Dismiss message
- Logout and back in again
- See verify the broadcast message is still dismissed
Related to #438595 (closed)
Edited by Ross Byrne