Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • D dikdikdik
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 55
    • Issues 55
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • rva-vzw
  • dikdikdik
  • Issues
  • #216
Closed
Open
Issue created Jan 20, 2022 by Johan Vervloet@johanvOwner

Projectors send too many messages to mercure

This is code from the ScoreBoardProjector:

    public function __invoke(Event $event): void
    {
        parent::__invoke($event);

        if ($event instanceof TableAwareEvent) {
            $this->notifier->notify(
                new ScoreLogUpdateNotification($event->getTableIdentifier()),
            );

            return;
        }

        // I wish I had provided a TableIdentifier in every event this projector listens to.
        if ($event instanceof SheetAffectingEvent) {
            $tableIdentifier = $this->tablesBySheet->getTableByScoreSheet(
                $event->getScoreSheetIdentifier()
            );
            $this->notifier->notify(
                new ScoreLogUpdateNotification($tableIdentifier),
            );
        }
    }

This sends a notification to the notifier on every TableAwareEvent and every SheetAffectingEvent, even if the projector doesn't do anything with the event. We should emit a notification in the concrete handler methods, and only if something has effectively changed.

This should be fixed in every notifying projector.

Assignee
Assign to
Time tracking