You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You'll see that the call to send fails with noItemInResponse, and in the logs we see
Could not messagepack object: AblyChat.MetadataValue.number(12)
Could not messagepack object: AblyChat.MetadataValue.string("what")
WARN: (ARTHttp.m:57) unable to publish chat message; cannot decode request body
Could not messagepack object: AblyChat.HeadersValue.string("what")
Could not messagepack object: AblyChat.HeadersValue.number(12)
WARN: (ARTHttp.m:57) unable to publish chat message; cannot decode request body
lawrence-forooghian
changed the title
Sending a message with metadata doesn't work
Sending a message with metadata or headers doesn't work
Dec 12, 2024
We were not serializing or deserializing the Chat SDK’s Metadata and
Headers types. This was a mistake in 8b6e56a.
I was surprised to find that there were no existing tests for the
request that ChatAPI makes when you call sendMessage, nor for
DefaultMessages’s handling of messages received over a realtime channel,
which meant that there wasn’t an obvious place to slot in the tests for
the fixes introduced by this commit, nor did the mocks have any support
for writing such tests. I’ve added tests for my fixes but, given my rush
to get this fix done, the changes to the mocks aren’t great. Have
created issue #195 for us come back and write the missing tests and tidy
mine up.
Note that I’ve removed the optionality of Metadata’s values. This
optionality came from 20e7f5f when it was unclear what Metadata would
be. We probably should have removed it in 8b6e56a when we introduced
`null` as a MetadataValue case.
Resolves#193.
In the integration tests, try adding the following to a call to
room.messages.send
:You'll see that the call to
send
fails withnoItemInResponse
, and in the logs we seeSimilarly, with headers:
we get
┆Issue is synchronized with this Jira Task by Unito
The text was updated successfully, but these errors were encountered: