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

temp fix to chainreader error when no workflows #15678

Merged
merged 2 commits into from
Dec 13, 2024
Merged
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
13 changes: 11 additions & 2 deletions core/services/workflows/syncer/workflow_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"iter"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -222,8 +223,16 @@ func (w *workflowRegistry) Start(_ context.Context) error {
w.lggr.Debugw("Loading initial workflows for DON", "DON", don.ID)
loadWorkflowsHead, err := w.initialWorkflowsStateLoader.LoadWorkflows(ctx, don)
if err != nil {
w.lggr.Errorw("failed to load workflows", "err", err)
return
// TODO - this is a temporary fix to handle the case where the chainreader errors because the contract
// contains no workflows. To track: https://smartcontract-it.atlassian.net/browse/CAPPL-393
if !strings.Contains(err.Error(), "attempting to unmarshal an empty string while arguments are expected") {
w.lggr.Errorw("failed to load workflows", "err", err)
return
}

loadWorkflowsHead = &types.Head{
Height: "0",
}
}

reader, err := w.getContractReader(ctx)
Expand Down
Loading