Skip to content

Commit 9260a31

Browse files
authored
Merge pull request #556 from obeli-sk/cleanup-replay-advance
refactor(workflow): Simplify `replay` and `advance` between WASM and JS workflow workers
2 parents e68bc7f + c385c66 commit 9260a31

3 files changed

Lines changed: 220 additions & 404 deletions

File tree

crates/wasm-workers/src/workflow/replay_db_proxy.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ impl ReplayEventCollector {
3737
pub(crate) async fn apply_writes(
3838
conn: &dyn DbConnection,
3939
actual: Vec<CapturedDbWrite>,
40-
version: Version,
40+
old_version: Version,
4141
) -> Result<Version, DbErrorWrite> {
42-
let mut new_version = version;
42+
let mut version = old_version; // In case `actual` is empty, just return the old version.
4343
for write in &actual {
4444
if let Some(v) = apply_captured_write(write, conn).await? {
45-
new_version = v;
45+
version = v;
4646
}
4747
}
48-
Ok(new_version)
48+
Ok(version)
4949
}
5050

5151
async fn apply_captured_write(

0 commit comments

Comments
 (0)