feat: Add Telnyx Adapter Improvements (#7811)#6
Open
deepshekhardas wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
2 issues found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/Utopia/Messaging/Adapter/SMS/Telnyx.php">
<violation number="1" location="src/Utopia/Messaging/Adapter/SMS/Telnyx.php:19">
P1: Making `$from` mandatory here is a breaking change: existing callers can no longer pass the sender on `SMSMessage`, and the current Telnyx test now instantiates this adapter with too few arguments.</violation>
</file>
<file name="tests/Messaging/Adapter/SMS/TelnyxTest.php">
<violation number="1" location="tests/Messaging/Adapter/SMS/TelnyxTest.php:16">
P1: Pass the Telnyx `from` value to the constructor; this test currently calls it with too few arguments and will fail immediately.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| public function __construct( | ||
| private string $apiKey, | ||
| private ?string $from = null | ||
| private string $from, |
There was a problem hiding this comment.
P1: Making $from mandatory here is a breaking change: existing callers can no longer pass the sender on SMSMessage, and the current Telnyx test now instantiates this adapter with too few arguments.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/Utopia/Messaging/Adapter/SMS/Telnyx.php, line 19:
<comment>Making `$from` mandatory here is a breaking change: existing callers can no longer pass the sender on `SMSMessage`, and the current Telnyx test now instantiates this adapter with too few arguments.</comment>
<file context>
@@ -11,55 +11,58 @@ class Telnyx extends SMSAdapter
public function __construct(
private string $apiKey,
- private ?string $from = null
+ private string $from,
) {
}
</file context>
| public function testSendSMS(): void | ||
| { | ||
| // $sender = new Telnyx(\getenv('TELNYX_API_KEY')); | ||
| $sender = new Telnyx(\getenv('TELNYX_API_KEY')); |
There was a problem hiding this comment.
P1: Pass the Telnyx from value to the constructor; this test currently calls it with too few arguments and will fail immediately.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/Messaging/Adapter/SMS/TelnyxTest.php, line 16:
<comment>Pass the Telnyx `from` value to the constructor; this test currently calls it with too few arguments and will fail immediately.</comment>
<file context>
@@ -11,18 +13,16 @@ class TelnyxTest extends Base
public function testSendSMS(): void
{
- // $sender = new Telnyx(\getenv('TELNYX_API_KEY'));
+ $sender = new Telnyx(\getenv('TELNYX_API_KEY'));
- // $message = new SMS(
</file context>
Suggested change
| $sender = new Telnyx(\getenv('TELNYX_API_KEY')); | |
| $sender = new Telnyx(\getenv('TELNYX_API_KEY'), \getenv('TELNYX_FROM')); |
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.
This PR adds improvements to the Telnyx adapter.
Changes:
Summary by cubic
Improves the Telnyx SMS adapter with per-recipient sending, a required
fromvalue, and clearer error messages. Aligns with Linear #7811.New Features
from(Telnyx phone number or profile ID).errors[0].detailwhen available.Migration
TELNYX_API_KEY,TELNYX_FROM,TELNYX_TO.Written for commit e416217. Summary will update on new commits.