Currently, when fetching a comment’s reactions (e.g., upvotes) from a given activity, there isn’t a straightforward way to determine if the currently authenticated user has already reacted (e.g., upvoted) without iterating through all returned reactions.
Use Case:
-
Imagine a scenario where I have an activity with a series of comment reactions.
-
On one of these comments, I’ve added an upvote reaction.
-
When I fetch the comment along with its child reactions (like upvotes), I receive a list of all upvote reactions. However, to find out if I (as the currently logged-in user) have upvoted this particular comment, I need to scan through all these reactions, which can be in the thousands.
-
This approach is inefficient and can lead to performance issues.
Problem: There’s no direct query parameter or built-in functionality to easily check whether the current user has already reacted to a comment. As a result, developers must rely on potentially expensive operations (e.g., iterating over large reaction sets) to determine user-specific reaction state.
Requested Feature:
-
Provide a method or parameter that, when fetching comment reactions, can directly inform the client if the current user has already reacted.
-
This could be similar to existing enrichment flags used for activities (e.g., withOwnReactions(userId)) but applied to reactions.
-
Alternatively, expose an endpoint or filter that combines LookupKind.USER and LookupKind.ACTIVITY to quickly fetch user-specific reactions for a given activity or comment without separate queries and manual filtering.
Currently, when fetching a comment’s reactions (e.g., upvotes) from a given activity, there isn’t a straightforward way to determine if the currently authenticated user has already reacted (e.g., upvoted) without iterating through all returned reactions.
Use Case:
Imagine a scenario where I have an activity with a series of comment reactions.
On one of these comments, I’ve added an upvote reaction.
When I fetch the comment along with its child reactions (like upvotes), I receive a list of all upvote reactions. However, to find out if I (as the currently logged-in user) have upvoted this particular comment, I need to scan through all these reactions, which can be in the thousands.
This approach is inefficient and can lead to performance issues.
Problem: There’s no direct query parameter or built-in functionality to easily check whether the current user has already reacted to a comment. As a result, developers must rely on potentially expensive operations (e.g., iterating over large reaction sets) to determine user-specific reaction state.
Requested Feature:
Provide a method or parameter that, when fetching comment reactions, can directly inform the client if the current user has already reacted.
This could be similar to existing enrichment flags used for activities (e.g., withOwnReactions(userId)) but applied to reactions.
Alternatively, expose an endpoint or filter that combines LookupKind.USER and LookupKind.ACTIVITY to quickly fetch user-specific reactions for a given activity or comment without separate queries and manual filtering.