diff --git a/src/main/java/io/getstream/client/ReactionsClient.java b/src/main/java/io/getstream/client/ReactionsClient.java index abdd5343..d2754881 100644 --- a/src/main/java/io/getstream/client/ReactionsClient.java +++ b/src/main/java/io/getstream/client/ReactionsClient.java @@ -36,8 +36,13 @@ public CompletableFuture get(String id) throws StreamException { public CompletableFuture getBatch(List ids) throws StreamException { final Token token = buildReactionsToken(secret, TokenAction.READ); - return reactions.getBatchReactions(token, ids); + return reactions.getBatchReactions(token, ids, false); } + + public CompletableFuture getBatch(List ids, Boolean includeDeleted) throws StreamException { + final Token token = buildReactionsToken(secret, TokenAction.READ); + return reactions.getBatchReactions(token, ids, includeDeleted); + } public CompletableFuture> filter(LookupKind lookup, String id) throws StreamException { diff --git a/src/main/java/io/getstream/core/StreamReactions.java b/src/main/java/io/getstream/core/StreamReactions.java index f8a08bc9..ab8702ff 100644 --- a/src/main/java/io/getstream/core/StreamReactions.java +++ b/src/main/java/io/getstream/core/StreamReactions.java @@ -344,7 +344,7 @@ public CompletableFuture restore(Token token, String id) throws StreamExce } } - public CompletableFuture getBatchReactions(Token token, List ids) throws StreamException { + public CompletableFuture getBatchReactions(Token token, List ids, Boolean includeDeleted) throws StreamException { checkNotNull(ids, "Reaction IDs can't be null"); checkArgument(!ids.isEmpty(), "Reaction IDs can't be empty"); @@ -352,10 +352,15 @@ public CompletableFuture getBatchReactions(Token token, List { try { diff --git a/src/test/java/io/getstream/client/ReactionsClientTest.java b/src/test/java/io/getstream/client/ReactionsClientTest.java index 8cc878b9..03a861c8 100644 --- a/src/test/java/io/getstream/client/ReactionsClientTest.java +++ b/src/test/java/io/getstream/client/ReactionsClientTest.java @@ -116,6 +116,17 @@ public void batchFetchReactions() throws Exception { assertEquals(req.getActivityID(), r.getActivityID()); assertEquals(req.getKind(), r.getKind()); } + + client.reactions().delete(r1.getId()).join(); + response = client.reactions().getBatch(List.of(r1.getId(), r2.getId(), r3.getId(), r4.getId(), r5.getId(), r6.getId()), true).join(); + result = response.getReactions(); + //Deleted reaction should be present in the response + assertEquals(6, resultMap.size()); + for (Reaction r : result) { + Reaction req = reactionsRequest.get(r.getId()); + assertEquals(req.getActivityID(), r.getActivityID()); + assertEquals(req.getKind(), r.getKind()); + } } @Test