stream-js
stream-js copied to clipboard
Options for `client.reactions.filter` behave differently with server-side auth and client-side auth
When trying to filter child reactions that a specific user made to a specific reaction, I use this code snippet:
const likes = (await client.reactions.filter({
reaction_id: 'some-comment-id',
filter_user_id: 'some-user-id',
kind: 'like',
limit: 1
}).results
I use filter_user_id (which is not documented anywhere by itself) here because I can't use reaction_id and user_id filters at the same time. The code snippet above works well only when the client is using server-side auth. When using client-side auth, however, the query result will be the latest child reaction of the specified reaction, instead of the specified user's child reaction of the specified reaction.