Skip to content

Commit

Permalink
Fix parsing domain_id in child_info_maps for backward compatibility (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaddoll authored Feb 1, 2022
1 parent dea6429 commit edf4cb4
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ package cassandra
import (
"time"

cql "github.com/gocql/gocql"

"github.com/uber/cadence/common"
"github.com/uber/cadence/common/checksum"
"github.com/uber/cadence/common/persistence"
Expand All @@ -32,6 +34,8 @@ import (
"github.com/uber/cadence/common/types"
)

var _emptyUUID = cql.UUID{}

func parseWorkflowExecutionInfo(
result map[string]interface{},
) *persistence.InternalWorkflowExecutionInfo {
Expand Down Expand Up @@ -362,6 +366,10 @@ func parseChildExecutionInfo(
encoding = common.EncodingType(v.(string))
case "domain_id":
info.DomainID = v.(gocql.UUID).String()
if info.DomainID == _emptyUUID.String() {
// for backward compatibility, the gocql library doesn't handle the null uuid correectly https://github.com/gocql/gocql/blob/master/marshal.go#L1807
info.DomainID = ""
}
case "domain_name":
info.DomainNameDEPRECATED = v.(string)
case "workflow_type_name":
Expand Down

0 comments on commit edf4cb4

Please sign in to comment.