Skip to content

Conversation

@hila-f-qodo
Copy link

Benchmark PR from qodo-benchmark#84

@augmentcode
Copy link

augmentcode bot commented Dec 31, 2025

🤖 Augment PR Summary

Summary: This PR refactors the web “apps” data layer toward TanStack Query (React Query), replacing several SWR/SWRInfinite usages with query hooks.

Changes:

  • Introduced/expanded web/service/use-apps.ts with React Query hooks for app lists (paged + infinite), app detail, statistics metrics, voices, and API keys.
  • Updated multiple UI entry points (account page, app overview charts, apps list, header app nav, plugin app selector, secret key modal) to use the new hooks instead of SWR.
  • Reworked infinite scrolling logic to use fetchNextPage/hasNextPage instead of setSize/has_more checks.
  • Adjusted API service helpers in web/service/apps.ts to return explicit Promise<…> types rather than SWR Fetcher typings.
  • Updated the demo service component to use TanStack Query primitives (useQuery, useMutation, invalidation).
  • Minor UI tweak in the empty state overlay class ordering.

Technical Notes: The new hooks standardize query keys under the apps namespace, enabling centralized invalidation (e.g., list and API keys) and reuse across the app.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

# Assert
assert result == expected_response
assert len(result["recommended_apps"]) == 2
mock_factory_class.get_recommend_app_factory.return_value = mock_factory
Copy link

Choose a reason for hiding this comment

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

mock_factory_class.get_recommend_app_factory.return_value is assigned after calling RecommendedAppService.get_recommended_apps_and_categories, so the service call won’t use mock_retrieval_instance and the assertion result == expected_response will likely fail.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

export const useInfiniteAppList = (params: AppListParams, options?: { enabled?: boolean }) => {
const normalizedParams = normalizeAppListParams(params)
return useInfiniteQuery<AppListResponse>({
queryKey: appListKey(params),
Copy link

Choose a reason for hiding this comment

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

In useInfiniteAppList, queryKey uses the raw params while the request uses normalizedParams; this can fragment the cache (e.g., defaults or mode: 'all') and make the key not accurately represent the fetched data.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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.

4 participants