Skip to content

Commit 14fe7cb

Browse files
committed
Fix: Update
1 parent fd1bf31 commit 14fe7cb

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

dbos/system_database.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,11 @@ func (s *sysDB) insertWorkflowStatus(ctx context.Context, input insertWorkflowSt
488488
var workflowDeadlineEpochMS *int64
489489

490490
// Marshal authenticated roles (slice of strings) to JSON for TEXT column
491-
authenticatedRoles, _ := json.Marshal(input.status.AuthenticatedRoles)
491+
authenticatedRoles, err := json.Marshal(input.status.AuthenticatedRoles)
492+
493+
if err != nil {
494+
return nil, fmt.Errorf("failed to marshal the authenticated roles: %w", err)
495+
}
492496

493497
err = input.tx.QueryRow(ctx, query,
494498
input.status.ID,
@@ -1101,7 +1105,11 @@ func (s *sysDB) forkWorkflow(ctx context.Context, input forkWorkflowDBInput) (st
11011105
}
11021106

11031107
// Marshal authenticated roles (slice of strings) to JSON for TEXT column
1104-
authenticatedRoles, _ := json.Marshal(originalWorkflow.AuthenticatedRoles)
1108+
authenticatedRoles, err := json.Marshal(originalWorkflow.AuthenticatedRoles)
1109+
1110+
if err != nil {
1111+
return "", fmt.Errorf("failed to marshal the authenticated roles: %w", err)
1112+
}
11051113

11061114
_, err = tx.Exec(ctx, insertQuery,
11071115
forkedWorkflowID,

dbos/workflows_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"errors"
66
"fmt"
7+
"log"
78
"reflect"
89
"runtime"
910
"sync"
@@ -4146,6 +4147,7 @@ func TestWorkflowIdentity(t *testing.T) {
41464147

41474148
// Retrieve the workflow's status.
41484149
status, err := handle.GetStatus()
4150+
log.Print(status)
41494151
require.NoError(t, err)
41504152

41514153
t.Run("CheckAuthenticatedUser", func(t *testing.T) {

0 commit comments

Comments
 (0)