Skip to content

Commit

Permalink
fix: treat just-expired document as inexistent
Browse files Browse the repository at this point in the history
  • Loading branch information
ClemaX authored and bsbodden committed Jul 7, 2024
1 parent 4faa66b commit 698784a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion demos/roms-documents/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<dependency>
<groupId>com.redis.om</groupId>
<artifactId>redis-om-spring</artifactId>
<version>0.9.3</version>
<version>0.9.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
2 changes: 1 addition & 1 deletion demos/roms-hashes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<dependency>
<groupId>com.redis.om</groupId>
<artifactId>redis-om-spring</artifactId>
<version>0.9.3</version>
<version>0.9.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
2 changes: 1 addition & 1 deletion demos/roms-permits/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<dependency>
<groupId>com.redis.om</groupId>
<artifactId>redis-om-spring</artifactId>
<version>0.9.3</version>
<version>0.9.4-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion demos/roms-vss/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<dependency>
<groupId>com.redis.om</groupId>
<artifactId>redis-om-spring</artifactId>
<version>0.9.3</version>
<version>0.9.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.redis.om</groupId>
<artifactId>redis-om-spring-parent</artifactId>
<version>0.9.3</version>
<version>0.9.4-SNAPSHOT</version>
<name>redis-om-spring-parent</name>
<packaging>pom</packaging>

Expand Down
2 changes: 1 addition & 1 deletion redis-om-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>com.redis.om</groupId>
<artifactId>redis-om-spring</artifactId>
<version>0.9.3</version>
<version>0.9.4-SNAPSHOT</version>
<packaging>jar</packaging>

<name>redis-om-spring</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,18 +501,13 @@ private Object executeQuery(Object[] parameters) {
}

private Object parseDocumentResult(redis.clients.jedis.search.Document doc) {
Gson gsonInstance = getGson();

if (doc == null) {
return gsonInstance.fromJson("", domainType);
if (doc == null || doc.get("$") == null) {
return null;
}

if (doc.get("$") != null) {
return gsonInstance.fromJson(SafeEncoder.encode((byte[]) doc.get("$")), domainType);
}
Gson gsonInstance = getGson();

return gsonInstance.fromJson(gsonInstance.toJsonTree(StreamSupport.stream(doc.getProperties().spliterator(), false)
.collect(Collectors.toMap(Entry::getKey, entry -> SafeEncoder.encode((byte[]) entry.getValue())))), domainType);
return gsonInstance.fromJson(SafeEncoder.encode((byte[]) doc.get("$")), domainType);
}

private Object executeDeleteQuery(Object[] parameters) {
Expand Down

0 comments on commit 698784a

Please sign in to comment.