fix: normalize SDK response shape in readMessagesFromSDK
Use response.data ?? response to handle both object and array-shaped SDK responses, consistent with all other SDK readers.
This commit is contained in:
parent
9889ac0dd9
commit
c1681ef9ec
@ -62,7 +62,7 @@ export async function readMessagesFromSDK(
|
||||
): Promise<StoredMessageMeta[]> {
|
||||
try {
|
||||
const response = await client.session.messages({ path: { id: sessionID } })
|
||||
const data: unknown = response.data
|
||||
const data: unknown = response.data ?? response
|
||||
if (!Array.isArray(data)) return []
|
||||
|
||||
const messages = data
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user