Skip to content

Commit

Permalink
fix: fix wf version bug with errored activities (#1706)
Browse files Browse the repository at this point in the history
<!-- Please make sure there is an issue that this PR is correlated to. -->

## Changes

<!-- If there are frontend changes, please include screenshots. -->
  • Loading branch information
MasterPtato committed Jan 2, 2025
1 parent 346088b commit 98a76cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/common/chirp-workflow/core/src/db/crdb_nats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,28 +748,30 @@ impl Database for DatabaseCrdbNats {
INSERT INTO db_workflow.workflow_activity_events (
workflow_id,
location2,
version,
activity_name,
input_hash,
input,
create_ts,
loop_location2
)
VALUES ($1, $2, $3, $4, $5, $7, $8)
VALUES ($1, $2, $3, $4, $5, $7, $8, $9)
ON CONFLICT (workflow_id, location2_hash) DO NOTHING
RETURNING 1
),
err AS (
INSERT INTO db_workflow.workflow_activity_errors (
workflow_id, location2, activity_name, error, ts
)
VALUES ($1, $2, $3, $6, $9)
VALUES ($1, $2, $4, $7, $10)
RETURNING 1
)
SELECT 1
",
))
.bind(workflow_id)
.bind(location)
.bind(version as i64)
.bind(&event_id.name)
.bind(event_id.input_hash.to_le_bytes())
.bind(sqlx::types::Json(input))
Expand Down

0 comments on commit 98a76cf

Please sign in to comment.