-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double base64encode #69
Comments
Hello @Sergio-Ben I actually don't use this package and I don't remember why I made that choice at the time. But initially, the topic auto-creation was not part of this package and I probably did assume that the "encoding" option was set to false. With the topic auto-creation, I believe all the messages are now automatically encoded to base64, so I agree with you it can be kind of inefficient now and it might be a good idea to disable this behavior. I'm open to a well-tested fix in PR. |
Hey @kainxspirits This actually has nothing to do with topic auto-creation.
in and then in The same flag is used to check if the message should be encoded or not. But yes, i'll try to find some spare time and create some PR, so you can review it :) |
Hey there. While using this package, I noticed my payload that running through google pub/sub is encoded twice.
The problem is in the
PubSubQueue
class inpushRaw
function$publish = ['data' => base64_encode($payload)];
On this line we are encoding our payload, and then in
$topic->publish($publish);
We are actually executing code from Google/cloud-pubsub library, which is doing exactly the same, so the payload is encoded twice at the stage of sending it to the pub/sub.
The same if for pulling messages from subscriptions, Google package doing the base64_decode by itself.
Just wondering what was the initial purpose of encoding payload inside this package ?
The text was updated successfully, but these errors were encountered: