This repository has been archived by the owner on Feb 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Event recovery does not record last_version correctly #30
Comments
Here's a diff for the tests that makes it fail: diff --git a/src/entity.rs b/src/entity.rs
index 6f6a367..7728e73 100644
--- a/src/entity.rs
+++ b/src/entity.rs
@@ -625,7 +625,7 @@ mod tests {
let id = Uuid::from_u128(0);
- let mut counter = Counter::default().entity().build(id, pool).await?;
+ let mut counter = Counter::default().entity().build(id, pool.clone()).await?;
assert_eq!(counter.entity, Counter(0));
let result = counter.handle_command(Decrease(1)).await?;
@@ -633,8 +633,12 @@ mod tests {
let result = counter.handle_command(Increase(40)).await?;
assert_eq!(result, Ok(&Counter(40)));
+
let result = counter.handle_command(Decrease(20)).await?;
assert_eq!(result, Ok(&Counter(20)));
+
+ // reinstantiate the counter (to test that event recovery works)
+ let mut counter = Counter::default().entity().build(id, pool).await?;
let result = counter.handle_command(Increase(22)).await?;
assert_eq!(result, Ok(&Counter(42))); |
Btw. what's the difference between |
Ok, |
jrudolph
added a commit
to jrudolph/evented
that referenced
this issue
Jun 24, 2024
hseeberger
pushed a commit
that referenced
this issue
Jun 26, 2024
* fix: record last version after recovery Fixes #30 * simplify code
# for free
to subscribe to this conversation on GitHub.
Already have an account?
#.
Instead it always sets the
last_version
field to None inevented/src/entity.rs
Line 147 in 9d62331
evented/src/entity.rs
Line 318 in 9d62331
The text was updated successfully, but these errors were encountered: