fix(inbox): remove hardcoded 50-item limit from inbox list query

The ListInbox endpoint defaulted to LIMIT 50 while the frontend fetched
all items without pagination, causing items beyond the first 50 to be
silently dropped.
This commit is contained in:
Jiayuan 2026-03-31 18:36:41 +08:00
parent 3f612c37f2
commit 38cad92e7e
4 changed files with 2 additions and 30 deletions

View file

@ -239,15 +239,12 @@ FROM inbox_item i
LEFT JOIN issue iss ON iss.id = i.issue_id
WHERE i.workspace_id = $1 AND i.recipient_type = $2 AND i.recipient_id = $3 AND i.archived = false
ORDER BY i.created_at DESC
LIMIT $4 OFFSET $5
`
type ListInboxItemsParams struct {
WorkspaceID pgtype.UUID `json:"workspace_id"`
RecipientType string `json:"recipient_type"`
RecipientID pgtype.UUID `json:"recipient_id"`
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
}
type ListInboxItemsRow struct {
@ -270,13 +267,7 @@ type ListInboxItemsRow struct {
}
func (q *Queries) ListInboxItems(ctx context.Context, arg ListInboxItemsParams) ([]ListInboxItemsRow, error) {
rows, err := q.db.Query(ctx, listInboxItems,
arg.WorkspaceID,
arg.RecipientType,
arg.RecipientID,
arg.Limit,
arg.Offset,
)
rows, err := q.db.Query(ctx, listInboxItems, arg.WorkspaceID, arg.RecipientType, arg.RecipientID)
if err != nil {
return nil, err
}