hotfix: Don't handle git changes side effect too frequently (#8451)

This commit is contained in:
sp.wack 2025-05-12 20:57:00 +04:00 committed by GitHub
parent 0b897ff3dc
commit 8d0e5c6c34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ export const useGetGitChanges = () => {
// Latest changes should be on top
React.useEffect(() => {
if (result.data) {
if (!result.isFetching && result.isSuccess && result.data) {
const currentData = result.data;
// If this is new data (not the same reference as before)
@ -59,7 +59,7 @@ export const useGetGitChanges = () => {
}
}
}
}, [result.data]);
}, [result.isFetching, result.isSuccess, result.data]);
return {
data: orderedChanges,

View File

@ -226,7 +226,7 @@ def zip_current_workspace(request: Request) -> FileResponse | JSONResponse:
@app.get(
'/git/changes',
response_model=dict[str, Any],
response_model=list[dict[str, str]],
responses={
404: {'description': 'Not a git repository', 'model': dict},
500: {'description': 'Error getting changes', 'model': dict},
@ -236,7 +236,7 @@ async def git_changes(
request: Request,
conversation_id: str,
user_id: str = Depends(get_user_id),
) -> dict[str, Any] | JSONResponse:
) -> list[dict[str, str]] | JSONResponse:
runtime: Runtime = request.state.conversation.runtime
conversation_store = await ConversationStoreImpl.get_instance(
config,