Skip to content

Fix product count issue - #108

Merged
JBorrow merged 2 commits into
mainfrom
fix/number-of-products
Nov 6, 2026
Merged

JBorrow merged 2 commits into
mainfrom
fix/number-of-products

Conversation

@JBorrow

@JBorrow JBorrow commented Nov 6, 2026

Copy link
Copy Markdown
Member

Fixes the production issue of product number being incorrect.

Co-authored with GPT 6.1 Sol

CleanShot 2026-11-06 at 3 36 37 PM@2x

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The related-collections query lacks a multikey index on collections.$id, causing a full Product collection scan on each applicable page request with cost growing across all stored product versions.

1 open issue
What changed in this PR

Fixes incorrect product counts for parent and child collections by counting readable products directly rather than relying on hydrated links.

Changes:

  • Adds an access-aware aggregation that avoids counting duplicate collection links.
  • Passes computed counts to the collection-page template.
  • Adds regression coverage for permissions, empty collections, shared memberships, and rendered counts.
File Description
tests/​test_services/​test_collection_counts.py Tests service counts and rendered results across access levels.
hipposerve/​web/​templates/​collection.html Displays computed parent and child product counts.
hipposerve/​web/​__init__.py Supplies related-collection counts to the template.
hipposerve/​service/​collection.py Adds the access-filtered product-count aggregation.

Review effort: Balanced

Comment thread hipposerve/service/collection.py Resolved
@JBorrow
JBorrow merged commit 93e67c9 into main Nov 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants