Feat: Add OneSignal push provider adapter (#7726)#131
Conversation
Greptile SummaryThis PR adds a new
Confidence Score: 2/5Not ready to merge — multiple correctness issues in the payload-building and response-handling logic remain unaddressed from prior review rounds. The adapter has several open correctness gaps: src/Utopia/Messaging/Adapter/Push/OneSignal.php — the payload construction and response parsing logic need the most attention before this is production-ready. Important Files Changed
Reviews (3): Last reviewed commit: "fix: add parent constructor, fix deliver..." | Re-trigger Greptile |
| if (!\is_null($message->getSound())) { | ||
| $payload['android_sound'] = $message->getSound(); | ||
| $payload['ios_sound'] = $message->getSound() . '.wav'; | ||
| } |
There was a problem hiding this comment.
Other push adapters pass the message sound through unchanged, and callers may pass values like default or an already-qualified filename. Appending .wav here changes default to default.wav and chime.wav to chime.wav.wav, which can make iOS use the wrong sound or no custom sound at all.
| if (!\is_null($message->getSound())) { | |
| $payload['android_sound'] = $message->getSound(); | |
| $payload['ios_sound'] = $message->getSound() . '.wav'; | |
| } | |
| if (!\is_null($message->getSound())) { | |
| $payload['android_sound'] = $message->getSound(); | |
| $payload['ios_sound'] = $message->getSound(); | |
| } |
| if (!\is_null($message->getContentAvailable())) { | ||
| $payload['content_available'] = true; | ||
| } |
There was a problem hiding this comment.
content_available condition inverts intent when explicitly set to false
The guard !\is_null($message->getContentAvailable()) is true for both true and false. If a caller explicitly constructs Push with contentAvailable: false, the adapter still writes 'content_available' => true into the payload, silently enabling silent/background push on OneSignal devices when the caller's intent was the opposite. The fix is to check the boolean value directly: if ($message->getContentAvailable()).
…h fields (icon, color, tag, contentAvailable, priority)
6f22bda to
ec8ec39
Compare
|
Following up - OneSignal push adapter. Ready for review. |
No description provided.