Skip to content

fix(front): respect muted persons/repos for gitlab notifications#321

Open
timosaikkonen wants to merge 1 commit into
colinlienard:mainfrom
timosaikkonen:fix/gitlab-mute-precedence
Open

fix(front): respect muted persons/repos for gitlab notifications#321
timosaikkonen wants to merge 1 commit into
colinlienard:mainfrom
timosaikkonen:fix/gitlab-mute-precedence

Conversation

@timosaikkonen

Copy link
Copy Markdown

fix(front): respect muted persons/repos for GitLab notifications

Summary

Muting a person, bot, or repository does not stop GitLab desktop push notifications from that source.

Cause

The return filter in fetchGitlabNotifications (src/routes/(app)/dashboard/+page.svelte) relies on operator precedence between && and the ternary:

return newNotifications.filter((item) =>
    !notificationIsMuted(item, persons, repos) && $settings.gitlabOnlyInvolved
        ? !item.notInvolved
        : true
);

This parses as (!muted && gitlabOnlyInvolved) ? !notInvolved : true:

  • With gitlabOnlyInvolved off → condition is false → returns true for everything (muted items pass through).
  • With gitlabOnlyInvolved on → returns !notInvolved regardless of muted.

Either way, the mute state is never applied to the list that drives push notifications.

Fix

Wrap the ternary so the mute check always applies, mirroring the GitHub code path (return newNotifications.filter((item) => !notificationIsMuted(item, persons, repos))):

return newNotifications.filter(
    (item) =>
        !notificationIsMuted(item, persons, repos) &&
        ($settings.gitlabOnlyInvolved ? !item.notInvolved : true)
);

Test plan

  • Mute a person/bot or repo in the sidebar (or use "Mute bots")
  • Before: push notifications still arrive from the muted source
  • After: muted sources no longer trigger push notifications (they still appear muted in the list)

Operator precedence made the filter evaluate as
`(!muted && gitlabOnlyInvolved) ? !notInvolved : true`, so muted persons,
bots and repos were never excluded from the list that drives push
notifications. Muting a person/bot therefore had no effect on GitLab.

Wrap the ternary so the mute check always applies, matching the GitHub path.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant