Repository navigation
Reduce public forum catalog latency with SQL pagination and batched access checks - #17
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Public forum requests were loading and enriching the entire catalog before pagination and repeatedly querying category permissions. After the legacy import, this saturated the dev service and contributed to gateway timeouts. This change selects authorized topic IDs in SQL before enriching only the requested page, batches category ancestry/access checks, and computes category statistics in PostgreSQL with at most five participant previews per category.
Visibility, direct topic roles, search, watches, sorting, and unread state remain permission-aware. Counts remain available beyond the last page, including oversized page numbers. Real PostgreSQL/HTTP regression coverage checks guest/member/imported-role/admin access, restricted and deleted descendants, counts, pagination, search, watches, and personalized unread state.
This branch is based directly on
developand contains the catalog implementation, tests, and documentation. Earlier Jive migration tools and dependency changes are excluded. No database migration is required.Validation:
pnpm lintandpnpm buildpassed using the project Node version.TZ=UTC PUBLIC_FORUMS_TEST_DATABASE_URL=postgresql://postgres@127.0.0.1:55439/catalog_latency_http_test pnpm test --runInBand: 21 suites / 170 tests passed; one optional suite / three tests skipped. UTC is documented because the existing import provenance test compares PostgreSQL timestamps without time zones.forums-api-v6:27. The live guest/member audit verified all 844/854 visible legacy categories, topic/post counts, pagination, and private-thread denial.The deployment notes also record the separately applied dev infrastructure changes: two healthy ECS tasks and an ALB default JSON 404 for unmatched requests, with existing routes preserved. Monitoring and alarm configuration are unchanged.