Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Groups pagination multiplies the offset twice, causing empty pages after page 1

已关闭 适合新手
#541 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
74/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
backend, frontend

调研方向

从 Groups 路由文件 apps/start/src/routes/_app.$organizationId.$projectId.groups.tsx 第 52 行附近开始,那里计算了 cursor,然后与 group.service.ts 第 140 行附近对比,那里的偏移量是 cursor * take。检查 Profiles 页面在相同约定下如何计算 cursor。当第 2 页发送 cursor=1 并返回接下来的 50 个分组,且 Group Members 页面的 cursor 不匹配问题已修复或确认不在范围内时,即视为完成。

由索引模型根据 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

  1. Open the Groups list in a project with more than 100 groups, for example 120.
  2. Navigate to page 2 or page 3.
  3. Inspect the /api/trpc/group.list requests:
    • Page 2 sends take=50, cursor=50.
    • Page 3 sends take=50, cursor=100.
  4. Replay the requests with cursor=1 and cursor=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
平均合并
4 天 40 分钟
30 天内合并 PR
4

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Openpanel-dev/openpanel 的其他 Issue

查看 Openpanel-dev/openpanel 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。