-
Notifications
You must be signed in to change notification settings - Fork 11
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
Batch publish being sent as JSON rather than msgpack #197
Comments
@lmars is this error started happening recently? Also, can you list corresponding php version |
we have |
We've not looked at historical logs, but since 1000UTC today the rate of these errors started to climb significantly. |
This is the only change we made as a part of new release => ably-php/tests/PresenceTest.php Line 54 in 2a54c9e
Though CI is green on main branch.
|
I had created issue to fix flaky tests => #193 |
Some investigation: If you call If you pre-encode your request body (e.g. JSON) and pass it in to the method as The other route in, |
@AndyTWF thanks for the investigation ! I am going through the code. It will be super helpful if you can post link to routes for the same. Thanks again ! |
Sure:
|
Okay, I went through the code. I couldn't find anything that can decide irregularities between payload and headers : ( |
Okay, found something. In case of Line 115 in 2a54c9e
we are not explicitly setting headers for Content-Type |
In the requests that were problematic, the |
Okay, I understood what might be going wrong here =>
|
I agree a proper batch publish API would be a good thing, but is there not a fix needed for the generic |
Note -> We are not using batch publish in |
It can be both. Providing explicit documentation with working tests will be useful here 👍 |
@AndyTWF Actually we had a discussion in the standup and closing this for now since there are working tests + documentation for the same => https://github.com/ably/ably-php?tab=readme-ov-file#making-explicit-http-requests-to-ably-rest-endpoints--batch-publish. |
The Ably engineering team recently noticed server-side errors due to not being able to parse certain request bodies.
Upon investigation, the errors were all coming from clients sending batch publish requests using
ably-php/1.1.10
with aContent-Type
ofapplication/x-msgpack
but a JSON body.For example:
It is not correct for ably-php to send a JSON body with
Content-Type: application/x-msgpack
.┆Issue is synchronized with this Jira Task by Unito
The text was updated successfully, but these errors were encountered: