-
Notifications
You must be signed in to change notification settings - Fork 9
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
Using ->toOthers() results in a "Ably error: Malformed message; invalid connectionKey" #38
Comments
This is very unlikely to happen. How frequently does this happen? Also, what are the client side errors in laravel-echo ( if any ) |
No client side errors as the event doesn't dispatch from Laravel- the job fails. |
Okay, maybe you are using old ably broadcaster. Are you using
and then install
at client side. |
I originally followed the Pusher integration, but presence channels weren't behaving as expected. |
Ideally, it shouldn't persist. There might be something wrong with authentication being performed, wdyt? |
Also, make sure you are using php>=8 and followed proper setup. |
I will keep digging, it's not a show stopper at the moment as the core functionality works and we can implement a workaround for not triggering the callback on the client that fired the request. We are running PHP 8.2 in our environment. |
I am not sure how it can work if it doesn't contain
And make sure, your client side config. is
|
Btw, happy to hear presence is working for you : ) |
I am triggering message send endpoints via RapidAPI and just using the same JWT bearer token and X-SOCKET-ID as my actual UI in the headers. |
Please note that, only following interceptors are supported to capture |
The issue persists using the axios instance in the app with all headers present.
|
What is the value of |
Getting e91lyWF6gBZ7fm!m1zfd-NJj6AW1gTIHbt8mI-53d74 |
It is present in the headers in dev tools for all XHR requests |
Ohkay, can you double check if it's same as |
I've wrapped echo as a vue plugin, so it matches the output of |
`import Echo from '@ably/laravel-echo'; class EchoManager {
} // Vue Plugin |
The client side code seems to be working fine from what I can see. |
Okay, I'm not sure why you are using root api key in your client application. We haven't documented anywhere to set the api-key at client side. We have explicit note not to set it. Since, you have set it server side, you don't need to set it client side. You can remove it from your client code and it will work : ) |
That is not the root api key. |
In the setup section, we set it server side => https://github.com/ably/laravel-broadcaster?tab=readme-ov-file#setup. Client automatically gets JWT from server using this API key. Also, don't set
We have also documented not to set auth specific options -> https://github.com/ably-forks/laravel-echo?tab=readme-ov-file#installation |
oh |
If you explicitly want to request token, follow section => https://github.com/ably-forks/laravel-echo?tab=readme-ov-file#working-with-laravel-sanctum-support-channel-auth-using-custom-implementation |
Also, this is mostly not needed. ably-laravel-echo automatically makes request to given endpoint using internal http request and retrieves jwt. |
Please do star the repo, if issue is resolved : ) |
Will get the actual front-end devs to have a look at the UI integration in detail and let you know if we resolve the issue. |
Btw, do star the repo. I will be available if new queries come up 👍 |
Hi @diversitude let me know if we have update on this. Otherwise we can close the issue and open a new one if needed : ) |
@diversitude do we have updates on this |
Have been traveling, back in the codebase today and will provide updates if we've managed to fix it. |
Sure, that would be great ! |
@diversitude let me know if the fix is working for you. For reference, I recommend to go through full documentation under https://github.com/ably-forks/laravel-echo |
@diversitude let me know if this issue is resolved. Otherwise, we can close this and you can create a new issue if you find a bug in the future |
Hey, |
Hi! I have the same issue. There's no client-side error; the x-socket-id is matching. The error only occurs if the broadcast comes from a logged-in user. I use Laravel 10. @diversitude Did Laravel 11 fix the issue, or have you found any solution for this? |
@diversitude this issue is fixed! Please use the latest version of library. |
@draxvint can you please raise a new issue with steps to reproduce the same. Ideally, this issue shouldn't exist. . We have tested and it works in our demo app -> https://github.com/ably-labs/laravel-broadcast-app |
@diversitude @draxvint Issue has been fixed and released in latest version ( 1.0.6 ) of laravel-broadcaster and laravel-echo. Please update your packages accordingly. |
Triggering an event using
toOthers()
with X-Socket-ID in the request header results in an "Ably error: Malformed message; invalid connectionKey"┆Issue is synchronized with this Jira Task by Unito
The text was updated successfully, but these errors were encountered: