- Notifications
You must be signed in to change notification settings - Fork1.1k
fix(site): fix task link generation in AppStatuses component#20519
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
Uh oh!
There was an error while loading.Please reload this page.
| // Fetch task if workspace has an app status | ||
| const[task,setTask]=useState<Task|undefined>(undefined); | ||
| useEffect(()=>{ | ||
| if(workspace.latest_app_status?.agent_id===agent.id){ | ||
| API.experimental | ||
| .getTaskByWorkspaceID(workspace.id) | ||
| .then((task)=>setTask(task)) | ||
| .catch(()=>setTask(undefined));// Ignore errors, task may not exist | ||
| } | ||
| },[workspace.id,workspace.latest_app_status?.agent_id,agent.id]); |
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.
Should this instead make use ofuseQuery?
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.
Maybe something like
consttaskQuery=useQuery({queryKey:["tasks",workspace.id],queryFn:()=>API.experimental.getTaskByWorkspaceID(workspace.id),enabled:workspace.latest_app_status?.agent_id===agent.id,});
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.
Correct me if I'm wrong, but I think usingreact-query might require a deeper rearchitecture ofAgentRow.
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.
@aslilac might be able to shed some light here (or tell me i'm wrong 😄)
Would it make sense to put a nullable task ID on the workspace instead? |
johnstcn commentedOct 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Will give this a try. EDIT: see#20543 |
Closing in favour of#20543 |
Uh oh!
There was an error while loading.Please reload this page.
Fixes#20515
/api/experimental/task/workspace/{workspace}endpointAgentRowto conditionally fetch the relatedTaskifworkspace.has_ai_taskAppStatusesand updates theView tasklink with the task ID.NB: Claude did help me out here, but I reviewed all of the generated code.