fix(front): dedupe gitlab commit notifications by event id#320
Open
timosaikkonen wants to merge 1 commit into
Open
fix(front): dedupe gitlab commit notifications by event id#320timosaikkonen wants to merge 1 commit into
timosaikkonen wants to merge 1 commit into
Conversation
The push-event branch of the "keep only new/modified" filter was inverted and compared `item.ref`, which commit notifications never set (only merge request notifications carry `ref`, and it is not persisted). As a result a commit/push event was never recognized as already-seen and re-triggered a push notification on every poll (e.g. a bot commit notifying repeatedly). Remove the broken branch so push/commit events fall through to the default case, which matches by event id (the same id used to build the notification). Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(front): dedupe GitLab commit notifications by event id
Summary
When using GitLab, a commit/push notification (e.g. from a bot like renovate) is re-sent as a desktop push notification on every poll cycle, repeating indefinitely.
Cause
In
fetchGitlabNotifications(src/routes/(app)/dashboard/+page.svelte), the "keep only new or modified notifications" filter has a dedicated branch for push events:This branch is broken in two ways:
!), sofindmatches the first non-matching item.item.ref, but commit notifications never setref— only merge request notifications carry it, andrefisn't even persisted to storage.As a result, a push/commit event is never recognized as already-seen, is treated as new every cycle, and re-triggers a push notification.
Fix
Remove the broken branch so push/commit events fall through to the
defaultcase, which matches by event id — the same idcreateGitlabNotificationDataassigns to a commit notification.Test plan