-
Notifications
You must be signed in to change notification settings - Fork 21
Auto refetch run items when workflow run status has changed #1346
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
Conversation
| isValidating: isLoading, | ||
| }: SWRResponse<AiWorkflowRunItem[], Error> = useSWR<AiWorkflowRunItem[], Error>( | ||
| `${TC_API_BASE_URL}/workflows/${workflowId}/runs/${runId}/items`, | ||
| `${TC_API_BASE_URL}/workflows/${workflowId}/runs/${runId}/items?[${runStatus}]`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[correctness]
The query parameter [${runStatus}] in the URL is unconventional and may lead to unexpected behavior if not handled correctly. Consider using a standard query parameter format like runStatus=${runStatus}.
| `${TC_API_BASE_URL}/workflows/${workflowId}/runs/${runId}/items`, | ||
| `${TC_API_BASE_URL}/workflows/${workflowId}/runs/${runId}/items?[${runStatus}]`, | ||
| { | ||
| fetcher: url => xhrGetAsync(url.replace(`[${runStatus}]`, '')), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[correctness]
The use of url.replace([${runStatus}], '') to remove the run status from the URL is error-prone. If runStatus contains special characters, it might not be replaced correctly. Consider using a more robust method to construct the URL without the need for replacement.
| </div> | ||
|
|
||
| <p className={styles.modelDescription}> | ||
| <div className={styles.modelDescription}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[correctness]
Changing the <p> tag to a <div> tag for modelDescription might affect the semantics of the HTML. If the content is still a paragraph, consider using a <p> tag to maintain semantic correctness.
| </div> | ||
| </div> | ||
| <p className={styles.workflowDescription}> | ||
| <div className={styles.workflowDescription}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[correctness]
Changing the <p> tag to a <div> tag may affect the styling and semantics of the content. Ensure that the CSS styles and the semantic meaning of the content are preserved with this change.
Related JIRA Ticket:
https://topcoder.atlassian.net/browse/
What's in this PR?