Groups pagination multiplies the offset twice, causing empty pages after page 1
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Groups ルートファイル apps/start/src/routes/_app.$organizationId.$projectId.groups.tsx の約52行目から始めて、そこでカーソルが計算される箇所を確認し、group.service.ts の約140行目、オフセットが cursor * take になっている箇所と比較してください。Profiles ページが同じ規約でどのようにカーソルを計算しているかも確認してください。2ページ目が cursor=1 を送信し、次の50件のグループを返せば完了です。また、Group Members ページのカーソルの不一致は、修正するか、対象外であることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Description
The Groups list shows data on page 1, but subsequent pages are empty even though more groups exist.
I reproduced this in production. Manually changing the pagination parameters returns the expected data.
Steps to reproduce
- Open the Groups list in a project with more than 100 groups, for example 120.
- Navigate to page 2 or page 3.
- Inspect the
/api/trpc/group.listrequests:- Page 2 sends
take=50, cursor=50. - Page 3 sends
take=50, cursor=100.
- Page 2 sends
- Replay the requests with
cursor=1andcursor=2, respectively. Both return data in my production instance.
Expected behavior
With a page size of 50:
- Page 2 should skip 50 rows.
- Page 3 should skip 100 rows.
Root cause
The Groups frontend sends:
cursor: (page - 1) * PAGE_SIZE
The backend calculates:
OFFSET = cursor * take
This produces offsets of 2500 and 5000 instead of 50 and 100.
The Profiles frontend correctly sends cursor: page - 1, using the same backend pagination convention.
Suggested fix
Change the Groups frontend to cursor: page - 1.
The Group Members page has the same parameter mismatch based on source inspection, but I have not tested that page in production.
Environment
- Deployed version / image digest: [fill in]
- Source inspected: v2.3.0 and main at 7c4d22a
Source references
- 主要言語
- TypeScript
- スター
- 7.1k
- フォーク
- 516
- 平均マージ
- 34分
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Openpanel-dev/openpanel のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Openpanel-dev/openpanel#543 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
Openpanel-dev/openpanel#532 ·
メンテナーはふだん 1 日以内に返信
-
Period comparison badge shows wrong percentage for decreases (100 → 50 shows ↓100%)対応中かも @sarmah-rup が 17 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
Openpanel-dev/openpanel#526 ·
メンテナーはふだん 1 日以内に返信
-
Self-hosted missing op1-replay.js対応中かも @houstona が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Openpanel-dev/openpanel#512 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
login page needs refinement対応中かも @anandghegde が 32 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Openpanel-dev/openpanel#495 ·
メンテナーはふだん 1 日以内に返信
Openpanel-dev/openpanel の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug category:ai category:devices effort:s
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
LanternOps/breeze#8943 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
area:reliability difficulty:easy help wanted points:100 Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
Divinity-Labs/Lens#341 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信