Skip to content

Added Pushy Messaging Adapter - #149

Closed
deepshekhardas wants to merge 1 commit into
utopia-php:mainfrom
deepshekhardas:fix/pr-41-pushy
Closed

Added Pushy Messaging Adapter#149
deepshekhardas wants to merge 1 commit into
utopia-php:mainfrom
deepshekhardas:fix/pr-41-pushy

Conversation

@deepshekhardas

Copy link
Copy Markdown

Rebased on latest main. Updated adapter to current conventions.

@github-actions

Copy link
Copy Markdown

Thanks for contributing! This repository is a read-only mirror; development for this library happens in packages/messaging in the utopia-php monorepo. Please open this pull request there instead.

@github-actions github-actions Bot closed this Jul 25, 2026
@greptile-apps

greptile-apps Bot commented Jul 25, 2026

Copy link
Copy Markdown

Greptile Summary

Adds a Pushy push-notification adapter.

  • Sends batched data and notification payloads to Pushy using an API key.
  • Maps successful and client-error responses into the common messaging response format.
  • Sets a maximum batch size of 1,000 recipients.

Confidence Score: 3/5

The PR should not merge until Pushy reports transport, redirect, and server failures for every attempted recipient.

The request helper returns status code 0 and non-2xx HTTP responses normally, but the new adapter handles only 2xx and 4xx statuses, causing other failures to return an empty result set and bypass telemetry.

Files Needing Attention: src/Utopia/Messaging/Adapter/Push/Pushy.php

Important Files Changed

Filename Overview
src/Utopia/Messaging/Adapter/Push/Pushy.php Adds the Pushy adapter, but server, redirect, and transport failures produce no per-recipient results and lose failure telemetry.

Fix All in Claude Code Fix All in Codex

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
src/Utopia/Messaging/Adapter/Push/Pushy.php:54-68
**Non-client failures lose results**

When Pushy returns a redirect or server error, or the HTTP client reports a transport failure with status code 0, neither branch adds recipient results. This returns `deliveredTo=0` with an empty result set, discards the underlying error, and prevents failure telemetry from being recorded for the batch.

Reviews (1): Last reviewed commit: "Added Pushy Messaging Adapter" | Re-trigger Greptile

Comment on lines +54 to +68
if ($statusCode >= 200 && $statusCode < 300) {
$response->setDeliveredTo(\count($message->getTo()));
foreach ($message->getTo() as $to) {
$response->addResult($to);
}
} elseif ($statusCode >= 400 && $statusCode < 500) {
$error = '';
if (\is_array($responseBody) && isset($responseBody['error'])) {
$error = $responseBody['error'];
} elseif (\is_string($responseBody)) {
$error = $responseBody;
}

foreach ($message->getTo() as $to) {
$response->addResult($to, $error ?: 'Unknown error');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Non-client failures lose results

When Pushy returns a redirect or server error, or the HTTP client reports a transport failure with status code 0, neither branch adds recipient results. This returns deliveredTo=0 with an empty result set, discards the underlying error, and prevents failure telemetry from being recorded for the batch.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/Utopia/Messaging/Adapter/Push/Pushy.php
Line: 54-68

Comment:
**Non-client failures lose results**

When Pushy returns a redirect or server error, or the HTTP client reports a transport failure with status code 0, neither branch adds recipient results. This returns `deliveredTo=0` with an empty result set, discards the underlying error, and prevents failure telemetry from being recorded for the batch.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code Fix in Codex

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