This is an automated email from the ASF dual-hosted git repository.
pjfanning pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-projection.git
The following commit(s) were added to refs/heads/main by this push:
new cd5dce5 fix: handle DeletedDurableState in extractCreationTime
implementations (#453)
cd5dce5 is described below
commit cd5dce52a48562ff5d788e5a68f00b5bd7ede71c
Author: PJ Fanning <[email protected]>
AuthorDate: Fri May 1 13:34:47 2026 +0100
fix: handle DeletedDurableState in extractCreationTime implementations
(#453)
Agent-Logs-Url:
https://github.com/pjfanning/incubator-pekko-projection/sessions/83974b22-4556-491a-a5af-090d19cd9968
Co-authored-by: copilot-swe-agent[bot]
<[email protected]>
Co-authored-by: pjfanning <[email protected]>
---
.../projection/state/javadsl/DurableStateSourceProvider.scala | 8 +++-----
.../projection/state/scaladsl/DurableStateSourceProvider.scala | 8 +++-----
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git
a/durable-state/src/main/scala/org/apache/pekko/projection/state/javadsl/DurableStateSourceProvider.scala
b/durable-state/src/main/scala/org/apache/pekko/projection/state/javadsl/DurableStateSourceProvider.scala
index d2b2030..955a300 100644
---
a/durable-state/src/main/scala/org/apache/pekko/projection/state/javadsl/DurableStateSourceProvider.scala
+++
b/durable-state/src/main/scala/org/apache/pekko/projection/state/javadsl/DurableStateSourceProvider.scala
@@ -29,6 +29,7 @@ import pekko.annotation.InternalApi
import pekko.japi.Pair
import pekko.persistence.query.NoOffset
import pekko.persistence.query.Offset
+import pekko.persistence.query.DeletedDurableState
import pekko.persistence.query.DurableStateChange
import pekko.persistence.query.UpdatedDurableState
import pekko.persistence.query.javadsl.DurableStateStoreQuery
@@ -79,7 +80,7 @@ object DurableStateSourceProvider {
override def extractCreationTime(stateChange: DurableStateChange[A]): Long
=
stateChange match {
case u: UpdatedDurableState[_] => u.timestamp
- case _ => 0L // FIXME handle
DeletedDurableState when that is added
+ case d: DeletedDurableState[_] => d.timestamp
}
}
@@ -138,10 +139,7 @@ object DurableStateSourceProvider {
override def extractCreationTime(stateChange: DurableStateChange[A]): Long
=
stateChange match {
case u: UpdatedDurableState[_] => u.timestamp
- case other =>
- // FIXME case DeletedDurableState when that is added
- throw new IllegalArgumentException(
- s"DurableStateChange [${other.getClass.getName}] not implemented
yet. Please report bug at
https://github.com/apache/pekko-persistence-r2dbc/issues")
+ case d: DeletedDurableState[_] => d.timestamp
}
override def getObject(persistenceId: String):
CompletionStage[GetObjectResult[A]] =
diff --git
a/durable-state/src/main/scala/org/apache/pekko/projection/state/scaladsl/DurableStateSourceProvider.scala
b/durable-state/src/main/scala/org/apache/pekko/projection/state/scaladsl/DurableStateSourceProvider.scala
index 88c29b0..813bf72 100644
---
a/durable-state/src/main/scala/org/apache/pekko/projection/state/scaladsl/DurableStateSourceProvider.scala
+++
b/durable-state/src/main/scala/org/apache/pekko/projection/state/scaladsl/DurableStateSourceProvider.scala
@@ -23,6 +23,7 @@ import pekko.actor.typed.ActorSystem
import pekko.annotation.ApiMayChange
import pekko.persistence.query.NoOffset
import pekko.persistence.query.Offset
+import pekko.persistence.query.DeletedDurableState
import pekko.persistence.query.DurableStateChange
import pekko.persistence.query.UpdatedDurableState
import pekko.persistence.query.scaladsl.DurableStateStoreQuery
@@ -70,7 +71,7 @@ object DurableStateSourceProvider {
override def extractCreationTime(stateChange: DurableStateChange[A]): Long
=
stateChange match {
case u: UpdatedDurableState[_] => u.timestamp
- case _ => 0L // FIXME handle
DeletedDurableState when that is added
+ case d: DeletedDurableState[_] => d.timestamp
}
}
@@ -127,10 +128,7 @@ object DurableStateSourceProvider {
override def extractCreationTime(stateChange: DurableStateChange[A]): Long
=
stateChange match {
case u: UpdatedDurableState[_] => u.timestamp
- case other =>
- // FIXME case DeletedDurableState when that is added
- throw new IllegalArgumentException(
- s"DurableStateChange [${other.getClass.getName}] not implemented
yet. Please report bug at
https://github.com/apache/pekko-persistence-r2dbc/issues")
+ case d: DeletedDurableState[_] => d.timestamp
}
override def getObject(persistenceId: String): Future[GetObjectResult[A]] =
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]