Skip to content

PM-3786 #time 30min build & lint fixes#1727

Merged
vas3a merged 1 commit intodevelopfrom
PM-3786_ai-assisted-skills
Feb 12, 2026
Merged

PM-3786 #time 30min build & lint fixes#1727
vas3a merged 1 commit intodevelopfrom
PM-3786_ai-assisted-skills

Conversation

@vas3a
Copy link
Collaborator

@vas3a vas3a commented Feb 12, 2026

No description provided.

`${TC_AI_API_BASE_URL}/workflows/${workflowId}/create-run`
)
const runId = runResponse.data?.runId
const runId = runResponse.data && runResponse.data.runId

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 readability]
The change from optional chaining (?.) to a logical AND (&&) operator for accessing runId is technically correct, but it reduces readability. Optional chaining is more concise and directly conveys the intent of accessing a nested property safely. Consider reverting to optional chaining unless there's a specific reason for this change.

const result = response.data
const status = result?.status

const result = response.data || {}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
The change from optional chaining (?.) to using a logical OR (||) for response.data is correct and ensures that result is always an object, which is a good defensive programming practice. However, ensure that this change is consistent with the rest of the codebase.


if (status === 'failed') {
const errorMsg = result?.error?.message || 'Workflow execution failed'
const errorMsg = (result.error && result.error.message) || 'Workflow execution failed'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 readability]
The change from optional chaining (?.) to a logical AND (&&) operator for accessing result.error.message is technically correct, but it reduces readability. Optional chaining is more concise and directly conveys the intent of accessing a nested property safely. Consider reverting to optional chaining unless there's a specific reason for this change.

console.log('Workflow completed successfully')

return result.result ?? {}
return result.result || {}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
The change from optional chaining (??) to a logical OR (||) operator for returning result.result is technically correct and ensures that an empty object is returned when result.result is null or undefined. Ensure this change aligns with the intended behavior of the function.

@vas3a vas3a merged commit c091375 into develop Feb 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant