Skip to content

Conversation

@syntrydy
Copy link
Contributor

@syntrydy syntrydy commented Nov 27, 2025

#2480
Closes #2480

7 pages using Orval

  1. AgamaListPage - Has cache invalidation ✅
  2. ScopeListPage - Has cache invalidation ✅
  3. SessionListPage - Uses refetch() instead
  4. SsaListPage - Uses refetch() instead
  5. UserList - Has cache invalidation ✅
  6. AttributeListPage - Has cache invalidation ✅
  7. JwkListPage - Read-only (no mutations)

Summary by CodeRabbit

  • Chores
    • Modified data caching behavior for Agama projects to ensure more frequent data refresh cycles.

✏️ Tip: You can customize this high-level summary in your review settings.

@syntrydy syntrydy requested a review from moabu November 27, 2025 14:11
@syntrydy syntrydy self-assigned this Nov 27, 2025
@syntrydy syntrydy requested a review from duttarnab as a code owner November 27, 2025 14:11
@syntrydy syntrydy added comp-admin-ui Component affected by issue or PR comp-docker-admin-ui Component affected by issue or PR labels Nov 27, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 27, 2025

📝 Walkthrough

Walkthrough

Query caching behavior modified for the Agama projects list. Added staleTime: 0 and gcTime: 0 options to the useGetAgamaPrj hook to prevent stale data caching, ensuring the list displays current deployment status without relying on cached results.

Changes

Cohort / File(s) Change Summary
Agama List Query Caching
admin-ui/plugins/auth-server/components/Agama/AgamaListPage.tsx
Added query options staleTime: 0 and gcTime: 0 to useGetAgamaPrj hook invocation to disable query caching and garbage collection, forcing fresh data retrieval on each access

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Single file with minimal configuration change
  • Query option parameters added; no logic alterations
  • No public API changes or architectural modifications

Poem

🐰 With carrot-fresh eyes, we hop and we check,
No stale cached data to wreck the deck!
staleTime and gcTime set to zero's delight,
Now Agama flows refresh, always right!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR addresses issue #2480 by adding staleTime: 0 and gcTime: 0 to force fresh data fetches on list pages. However, only AgamaListPage is modified, while the issue mentions 7 affected list pages requiring similar fixes. Apply the same cache invalidation strategy (staleTime: 0, gcTime: 0) to the remaining affected list pages: ScopeListPage, SessionListPage, SsaListPage, UserList, AttributeListPage, and JwkListPage to fully resolve the stale data issue across all features.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing stale data display on admin UI list pages by disabling caching, which directly addresses the issue of outdated records appearing after updates.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to AgamaListPage and directly targets the stale data caching issue. No out-of-scope modifications are present.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch admin-ui-2480

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 604ddd2 and 10f36e2.

📒 Files selected for processing (1)
  • admin-ui/plugins/auth-server/components/Agama/AgamaListPage.tsx (1 hunks)
🔇 Additional comments (1)
admin-ui/plugins/auth-server/components/Agama/AgamaListPage.tsx (1)

122-133: Agama projects query cache configuration aligns with “no stale data” requirement

Adding staleTime: 0 and gcTime: 0 under the query options for useGetAgamaPrj is consistent with TanStack Query v5 semantics: data is treated as immediately stale and the cache is garbage-collected as soon as the query becomes inactive, so every new visit to this page will trigger a fresh GET and won’t reuse prior cached results across unmounts. This looks correct for the Agama Flows requirement, assuming no other component mounts the same query key concurrently with a longer gcTime.

Please double‑check in the TanStack Query v5 / Orval‑generated hook docs that gcTime is indeed wired through the query options for useGetAgamaPrj as expected and that no other consumer of this query key relies on longer caching behavior.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mo-auto mo-auto added the kind-bug Issue or PR is a bug in existing functionality label Nov 27, 2025
@moabu moabu merged commit 24072d8 into main Nov 27, 2025
4 of 5 checks passed
@moabu moabu deleted the admin-ui-2480 branch November 27, 2025 16:47
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-admin-ui Component affected by issue or PR comp-docker-admin-ui Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(admin-ui): stale data is displayed on the List page of Admin UI features on updating the records

4 participants