fix(frontend): keep bundle pagination page count correct after deletes - #2787
Conversation
Inferring page size from the current page length made last-page/next controls jump past real pages when the final page was short after bundle deletes. Use an explicit offset and clamp out-of-range pages. Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 36 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughDataTable now supports fixed page sizes for pagination calculations. App and table components pass explicit offsets, while BundleTable clamps and refetches when updated totals invalidate the current page. ChangesPagination behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant TableView
participant DataTable
participant BundleTable
participant DataSource
TableView->>DataTable: provide offset and total
DataTable->>TableView: emit current page changes
BundleTable->>DataSource: fetch page data and count
DataSource-->>BundleTable: return elements and total
BundleTable->>BundleTable: clamp out-of-range current page
BundleTable->>DataTable: provide corrected offset and elements
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_9c58f203-7b79-400e-b5bb-ac80af413982) |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/tables/BundleTable.vue`:
- Around line 250-257: Update the pagination handling in getData so the
clamped-page refetch is awaited before the invocation clears isLoading, keeping
loading active until fresh rows arrive. Coordinate the currentPage update with
the DataTable automatic reload mechanism to prevent issuing both the automatic
request and the explicit getData request.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 60d4d4d0-21bf-4f46-8959-457633eb5384
📒 Files selected for processing (8)
src/components/DataTable.vuesrc/components/tables/AppTable.vuesrc/components/tables/BundleTable.vuesrc/components/tables/ChannelHistoryTable.vuesrc/components/tables/ChannelTable.vuesrc/components/tables/DeviceTable.vuesrc/components/tables/HistoryTable.vuesrc/pages/apps.vue
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
Cap-go/capacitor-updater(manual)
Keep loading state true until the out-of-range page refetch finishes. Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_73cd145c-4f37-40f6-a38f-f3d7420f77a6) |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/components/tables/BundleTable.vue (1)
250-257:⚠️ Potential issue | 🟡 MinorAvoid refetching the clamped page twice.
currentPage.value = maxPagecan trigger DataTable’s automatic reload, while this branch also callsawait getData(). That can issue two requests for the same page and allow the last response to overwrite the table state. Make one path authoritative: suppress the automatic reload for this correction or rely on it instead of explicitly refetching.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/tables/BundleTable.vue` around lines 250 - 257, Update the clamped-page handling in getData so changing currentPage.value to maxPage does not trigger a second fetch alongside the explicit await getData() call. Make the correction path authoritative by suppressing DataTable’s automatic reload while retaining the awaited refetch, and preserve the existing loading and return behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@src/components/tables/BundleTable.vue`:
- Around line 250-257: Update the clamped-page handling in getData so changing
currentPage.value to maxPage does not trigger a second fetch alongside the
explicit await getData() call. Make the correction path authoritative by
suppressing DataTable’s automatic reload while retaining the awaited refetch,
and preserve the existing loading and return behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 68183945-6eb2-4a25-9cf3-d0004aaf4490
📒 Files selected for processing (1)
src/components/tables/BundleTable.vue
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
Cap-go/capacitor-updater(manual)
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Keep the table on a valid page when the last item on a page is deleted, matching BundleTable pagination behavior. Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_10f7de32-ca75-4054-b29a-b4e96f00c5e9) |
Extract clamp-and-refetch into one helper so BundleTable and ChannelTable do not duplicate pagination recovery after deletes. Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_d7b42931-d91a-44ee-bcc3-931c38f49606) |
|



Summary (AI generated)
DataTablepagination so last-page / next controls use a fixed page size (offset) instead of the current page’s row countoffsetfrom bundle and other server-side tables (channels, devices, history, apps, builds already passed it)BundleTablewhen deletes shrink the total below the active pageMotivation (AI generated)
After deleting bundles, the last page often has fewer rows than the page size.
DataTablepreviously treated that short page length as the page size, so “last page” and “next” calculated too many pages and produced empty/weird navigation.Business Impact (AI generated)
Improves console UX for customers managing large bundle lists so pagination stays trustworthy after cleanup/deletes.
Test Plan (AI generated)
Generated with AI
Summary by CodeRabbit