diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/MessagesCache.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/MessagesCache.java index d26bc0b7d..6dc3cf903 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/MessagesCache.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/MessagesCache.java @@ -444,7 +444,7 @@ private Mono maybeRunMrmViewExperiment(final MessageProtos.Envelope mrmMessag conn -> conn.reactive().hmget(key, "data".getBytes(StandardCharsets.UTF_8), sharedMrmViewKey) .collectList() .publishOn(messageDeliveryScheduler))) - .handle((mrmDataAndView, sink) -> { + .handle((mrmDataAndView, sink) -> { try { assert mrmDataAndView.size() == 2; @@ -461,7 +461,8 @@ private Mono maybeRunMrmViewExperiment(final MessageProtos.Envelope mrmMessag } catch (Exception e) { sink.error(e); } - }); + }) + .share(); experiment.compareMonoResult(mrmMessage.toBuilder().clearSharedMrmKey().build(), mrmMessageMono); diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/MessagesCacheTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/MessagesCacheTest.java index c5fd61bd0..1a8098626 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/MessagesCacheTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/MessagesCacheTest.java @@ -575,7 +575,7 @@ void testMultiRecipientMessage(final boolean sharedMrmKeyPresent) throws Excepti if (sharedMrmKeyPresent) { sharedMrmDataKey = messagesCache.insertSharedMultiRecipientMessagePayload(mrm); } else { - sharedMrmDataKey = new byte[]{1}; + sharedMrmDataKey = "{1}".getBytes(StandardCharsets.UTF_8); } final UUID guid = UUID.randomUUID();