Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip deleted proposals when checking isJobManaged #14281

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tricky-eagles-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

skip checking isJobManaged if the proposal in fms has already been deleted #changed
1 change: 1 addition & 0 deletions core/services/feeds/orm.go
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ SELECT exists (
FROM job_proposals
INNER JOIN jobs ON job_proposals.external_job_id = jobs.external_job_id
WHERE jobs.id = $1
AND job_proposals.status <> 'deleted'
);
`

Expand Down
8 changes: 8 additions & 0 deletions core/services/feeds/orm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,14 @@ func Test_ORM_IsJobManaged(t *testing.T) {
isManaged, err = orm.IsJobManaged(ctx, int64(j.ID))
require.NoError(t, err)
assert.True(t, isManaged)

// delete the proposal
err = orm.DeleteProposal(ctx, jpID)
require.NoError(t, err)

isManaged, err = orm.IsJobManaged(ctx, int64(j.ID))
require.NoError(t, err)
assert.False(t, isManaged)
}

// Helpers
Expand Down
Loading