Skip to content

Commit 9b2fedd

Browse files
committed
Fix hybrid strategy
1 parent f0d15f9 commit 9b2fedd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Transport/GpsReceiver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ private function getGpsReceivedStamp(Envelope $envelope): GpsReceivedStamp
113113
*/
114114
private function createEnvelopeFromPubSubMessage(Message $message): Envelope
115115
{
116-
if (EncodingStrategy::Hybrid === $this->encodingStrategy && str_starts_with($message->data(), '{"body":"{')) {
116+
if (EncodingStrategy::Hybrid === $this->encodingStrategy && str_starts_with($message->data(), '{"body":"')) {
117117
$rawData = $this->decodeWrappedMessage($message);
118118

119119
return $this->serializer->decode($rawData)->with(new GpsReceivedStamp($message));
120120
}
121121

122-
if (EncodingStrategy::Flat === $this->encodingStrategy) {
122+
if (EncodingStrategy::Hybrid === $this->encodingStrategy || EncodingStrategy::Flat === $this->encodingStrategy) {
123123
$envelope = $this->serializer->decode([
124124
'body' => $message->data(),
125125
'headers' => $message->attributes(),

0 commit comments

Comments
 (0)