fix(restart_context): add rows.Err() checks after Next() loops #2057

Closed
core-be wants to merge 2 commits from fix/restart-context-rows-err into staging
2 changed files with 6 additions and 9 deletions
@@ -407,15 +407,6 @@ func validateCallerToken(ctx context.Context, c *gin.Context, callerID string) e
// matching (the wsauth errors are typed for the invalid case).
var errInvalidCallerToken = errors.New("missing caller auth token")
// canvasUserMessage holds the extracted user message extracted from an
// A2A canvas request body for broadcasting to other sessions.
type canvasUserMessage struct {
Message string `json:"message,omitempty"`
Parts []map[string]interface{} `json:"parts,omitempty"`
MessageID string `json:"messageId,omitempty"`
Attachments []map[string]interface{} `json:"attachments,omitempty"`
}
// extractCanvasUserMessage parses an A2A JSON-RPC request body and extracts
// the user-authored text and attachments from a canvas-initiated message/send.
// Returns nil when the body is not a canvas user message (empty, malformed,
@@ -139,6 +139,9 @@ func loadRestartContextData(ctx context.Context, workspaceID string) restartCont
keySet[k] = struct{}{}
}
}
if err := rows.Err(); err != nil {
log.Printf("restart-context: global_secrets rows error: %v", err)
}
rows.Close()
}
if rows, err := db.DB.QueryContext(ctx,
@@ -150,6 +153,9 @@ func loadRestartContextData(ctx context.Context, workspaceID string) restartCont
keySet[k] = struct{}{}
}
}
if err := rows.Err(); err != nil {
log.Printf("restart-context: workspace_secrets rows error: %v", err)
}
rows.Close()
}
for k := range keySet {