Skip to content

fix(aggregations): update content of the intitial closed aggs.#841

Open
jma wants to merge 1 commit into
rero:stagingfrom
jma:maj-fix-4177
Open

fix(aggregations): update content of the intitial closed aggs.#841
jma wants to merge 1 commit into
rero:stagingfrom
jma:maj-fix-4177

Conversation

@jma

@jma jma commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Set included property to true when an aggregation is proccessed in order to be added for the next fetchRecords call.

Co-Authored-By: Johnny Mariéthoz johnny.mariethoz@rero.ch
Co-Authored-By: Bertrand Zuchuat bertrand.zuchuat@rero.ch

@jma
jma marked this pull request as ready for review July 22, 2026 10:02
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The aggregation enrichment logic now explicitly sets included: true on the enriched aggregation object produced by enrichAggregation.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is related to the aggregation update, though it is a bit vague and contains a typo.
Description check ✅ Passed The description directly matches the change by explaining that processed aggregations are marked included for the next fetch.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@projects/rero/ng-core/src/lib/record/component/search/store/features/with-aggregations.feature.ts`:
- Line 174: Update the enriched aggregation handling around the included field
so it does not unconditionally set included to true. Preserve the existing
included state, or derive it from the request that triggered enrichment,
ensuring closed aggregations remain false and facetsParameter excludes them from
subsequent searches.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4549ddf0-3f27-4c5d-b23e-11d8930e1435

📥 Commits

Reviewing files that changed from the base of the PR and between faf8b97 and f2aa4e0.

📒 Files selected for processing (1)
  • projects/rero/ng-core/src/lib/record/component/search/store/features/with-aggregations.feature.ts

type: esAggregation.type || aggregation.type || 'terms',
config: esAggregation.config || aggregation.config,
name: aggregation.name || esAggregation.name,
included: true,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not unconditionally mark enriched aggregations as included.

This overwrites included: false for closed aggregations returned by Elasticsearch. Since facetsParameter uses included to decide which aggregations to request, this can cause closed facets to be included in subsequent searches; the supplied spec explicitly expects enriched closed aggregations to remain false. Preserve the existing state or derive inclusion from the specific request that triggered enrichment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@projects/rero/ng-core/src/lib/record/component/search/store/features/with-aggregations.feature.ts`
at line 174, Update the enriched aggregation handling around the included field
so it does not unconditionally set included to true. Preserve the existing
included state, or derive it from the request that triggered enrichment,
ensuring closed aggregations remain false and facetsParameter excludes them from
subsequent searches.

Set `included` property to true when an aggregation is proccessed in order to be added for the next fetchRecords call.

* Closes rero/rero-ils#4177.

Co-Authored-By: Johnny Mariéthoz <johnny.mariethoz@rero.ch>
Co-Authored-By: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
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.

Facets that are not open by default are not refreshing when updating other facets

1 participant