Skip to content

Commit

Permalink
Change client listener to receive events even without oldValue
Browse files Browse the repository at this point in the history
  • Loading branch information
wburns committed Oct 5, 2023
1 parent f72def4 commit b38e242
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void testRemovedEvent() {
withClientListener(l, remote -> {
l.expectNoEvents();
remote.remove(1);
l.expectNoEvents();
l.expectOnlyRemovedEvent(1);
remote.put(1, "one");
l.expectOnlyCreatedEvent(1);
remote.remove(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,8 @@ boolean isSendEvent(CacheEntryEvent<byte[], byte[]> event) {
switch (event.getType()) {
case CACHE_ENTRY_CREATED:
case CACHE_ENTRY_MODIFIED:
return !event.isPre();
case CACHE_ENTRY_REMOVED:
CacheEntryRemovedEvent removedEvent = (CacheEntryRemovedEvent) event;
return !event.isPre() && removedEvent.getOldValue() != null;
return !event.isPre();
case CACHE_ENTRY_EXPIRED:
return true;
default:
Expand Down

0 comments on commit b38e242

Please sign in to comment.