signals->findRecent($this->snapshotLimit); $snapshot = $this->snapshotBuilder->build($recentSignals); $payload = [ 'type' => 'snapshot', 'payload' => [ 'points' => $snapshot['points'], 'density' => $snapshot['density'], 'latestByUser' => $snapshot['latestByUser'], 'totals' => $snapshot['totals'], 'updatedAt' => new \DateTimeImmutable('now', new \DateTimeZone('UTC'))->format(DATE_ATOM), ], ]; $data = $this->serializer->serialize($payload, 'json'); $update = new Update(topics: $this->topic, data: $data); try { $this->hub->publish($update); } catch (Throwable $exception) { $this->logger->error('Failed to publish signal update to Mercure.', [ 'exception' => $exception, ]); } } }