precogly / precogly/precogly

Adopt getPage() in the API modules that discard pagination metadata

Open
#514 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
155
Forks
37
Avg merge
1d 17h
Merged PRs (30d)
82

Description

These hooks keep only `results` from a paginated response, so each list stops at 20 with nothing indicating more exists. Same bug as #484.

`getPage()` (`frontend/src/lib/api.ts`, added in #512) returns the whole `Page` and normalizes endpoints that return a bare array, so each of these is a per-module change.

Paths are relative to `frontend/src/features/`.

- [ ] `threat-models/api/threats.ts` — `/component-threats/`, `/flow-threats/`. Highest impact of these: a component with more than 20 threats shows 20 in threat analysis. Not currently reproducible, since seeded components carry at most 4 threats (measured 2026-09-09), so it needs an imported model or several library packs on one component.
- [ ] `organization/api/organizations.ts` — `/organizations/`, `/business-units/`, `/teams/`, `/team-invitations/`, `/magic-links/`, `/shared-with-me/`
- [ ] `threat-models/api/threat-models.ts` — `/threat-models/`, `/systems/`
- [ ] `threat-models/api/components.ts` — `/components/`, `/trust-zones/`
- [ ] `compliance/api/compliance.ts` — `/countermeasure-standards/`, `/instance-countermeasure-standards/`
- [ ] `threat-models/api/data-assets.ts` — `/data-assets/`
- [ ] `threat-models/api/data-flow-assets.ts` — `/data-flow-assets/`
- [ ] `threat-models/api/component-data-assets.ts` — `/component-data-assets/`
- [ ] `threat-models/api/reference-images.ts` — `/reference-images/`
- [ ] `threat-models/api/risks.ts` — `/countermeasure-comments/` (the risks list itself is done in #512)
- [ ] `libraries/api/libraries.ts` — `/dfd-templates/`
- [ ] `ai/api/aiProviders.ts` — `/ai-providers/`

Endpoints whose viewset sets `pagination_class = None` return bare arrays and truncate nothing, so they are not listed: every `*Library`, taxonomy, pack, framework, requirement, threat-source and out-of-scope-items list. `libraries.ts` and `compliance.ts` each hold a mix, which is why only some of their calls appear above.

Contributor guide

Open the contributing guide

Research direction

Start by reading getPage() in frontend/src/lib/api.ts and then inspect the listed API modules under frontend/src/features/. Compare the affected endpoint calls with the completed work in the risks list and verify each checked endpoint preserves its pagination metadata while the explicitly excluded bare-array endpoints remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.