feat: paginate subscription group memberships - #86
Conversation
|
Hey @kapdon, thx again for this PR! The SQL pagination and the test coverage look exactly like what we need for large subscription lists! :) Before I start the full review, the branch needs an update: Mainly, the files need to move to their owning modules:
No pagination changes expected here. If it’s easier for u, I can handle that update myself, no worries at all! Just tell me what u prefer. Once the branch is clean against |
d245874 to
57b6e7a
Compare
|
ok should be good now |
|
Thank you for the tremendous amount of work you put into this PR! I really appreciate the effort behind the pagination and membership changes :) I pushed a small follow-up to improve search performance and concurrent reads: trigram indexes for subscription search, shared locks for membership reads while preserving exclusive write locks, and read-only avatar enrichment. I also added tests for search scale, reader/writer concurrency, and avatar enrichment. I ran the full test suite, |
Summary
The subscription group manager currently waits for the complete membership projection before displaying a page. Add an API that filters, counts and paginates in PostgreSQL, then loads memberships and repairs avatars only for the returned channels.
Required by TypeType-Frontend #32, following the pagination review. Refs TypeType #172.
GET /subscriptions/group-memberships/page: zero-basedpage,limit(1–100), literal substringsearch, named/ungrouped/inverted membership filters, matching total and account-wide subscription/ungrouped counts. Order is lowercase name, then canonical URL. Offset pages reflect current results; they are not a cross-request snapshot.POST /subscriptions/group-memberships/lookup: read-only refresh of explicitly selected subscriptions retained across pages. Reuses the existing 500-URL, 2048-character and 1 MiB request limits, canonicalizes/deduplicates URLs and omits missing or foreign subscriptions.TEST_DATABASE_URL, withpg_trgminstalled in the shared test search path for repeat runs. The default Testcontainers setup remains available.Validation
./gradlew test shadowJar validateOpenApi checkwith JDK 25 and an isolated local PostgreSQL 16 database. 1,251 passed, 3 skipped againstdevat302b76e5; build, OpenAPI validation and coverage checks passed. Test libraries emit existing native-access/Unsafe runtime warnings.Companion frontend behavior was checked in Chromium with a 150-channel fixture: bounded page requests, retained selections/drafts, membership search and inversion, last-page adjustment, and failed selection-refresh recovery. Firefox/WebKit and a browser session against the running Kotlin server remain unverified.
No new dependencies or database migrations. Each commit has fewer than 300 insertions.