Conversation
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new App IEndpoint type to handle app-related endpoints in the Twilio SDK. The implementation ensures proper prefixing with "app:" and includes corresponding test coverage.
- Added App class implementing IEndpoint interface with automatic prefix handling
- Included comprehensive test coverage for various input scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Twilio/Types/App.cs | Implements the App class with prefix validation and string conversion |
| test/Twilio.Test/Types/AppTest.cs | Adds unit tests for the App class ToString method |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if (!app.ToLower().StartsWith(PREFIX)) | ||
| { | ||
| app = PREFIX + app; | ||
| } |
There was a problem hiding this comment.
The prefix check uses app.ToLower().StartsWith(PREFIX) but PREFIX is lowercase 'app:'. This means inputs like 'APP:test' or 'App:test' will incorrectly have the prefix added again, resulting in 'app:APP:test' or 'app:App:test'. Use case-insensitive comparison: !app.StartsWith(PREFIX, StringComparison.OrdinalIgnoreCase)
There was a problem hiding this comment.
It is working fine, check again.
app= "hello", outcome(_app) = "app:hello"
app= "app:hello", outcome(_app) = "app:hello"
app= "App:hello", outcome(_app) = "App:hello"
…onal handling uniform
|


Fixes
Added app IEndpoint type and its test case.
Checklist
If you have questions, please file a support ticket, or create a GitHub Issue in this repository.