Show the aggregations load error in the language filter

What

Fixes the language filter sidebar so the "Aggregations load error" alert can actually render. Right now it is dead code.

Why

In app/assets/javascripts/search/sidebar/components/language_filter/index.vue, the gl-alert error message lives inside a wrapper gated on v-if="hasBuckets". hasBuckets checks languageAggregationBuckets.length > 0, and that getter, in app/assets/javascripts/search/store/getters.js, reads the buckets out of state.aggregations.data. The RECEIVE_AGGREGATIONS_ERROR mutation in app/assets/javascripts/search/store/mutations.js sets data: [], so whenever error is true, hasBuckets is false, the wrapper never renders, and the alert inside it goes with it.

No other mutation produces a non-empty data together with error: true. REQUEST_AGGREGATIONS sets data: [] and error: false, REQUEST_AGGREGATIONS_LOADING preserves data but sets error: false, and RECEIVE_AGGREGATIONS_SUCCESS sets error: false. The result is that the whole Language section silently disappears on a failed request, with no explanation to the user.

This is not Zoekt-specific. blobs_filters.vue renders the language filter unconditionally for Advanced Search, so Advanced Search code search users hit this today.

Only the Language section is affected. Archived and Forks are sibling components that do not read aggregation data, so they render normally either way.

This is independent of !248990 (merged) and !251074 (closed) and can merge on its own. Those two make empty-but-successful responses more common, which makes distinguishing "nothing to show" from "the request failed" more valuable, but this fix stands alone.

How

Added an isVisible computed property returning hasBuckets || aggregations.error, and used it for the wrapper's v-if instead of hasBuckets. When there are no buckets and no error, the component still renders nothing, which is correct.

Testing

  • Enable FF zoekt_language_aggregations
  • Go to a code search page with blob results (Zoekt or Advanced Search), open Network tab.
  • Right-click the request to /search/aggregations → Block request URL.
  • Reload/search again. This forces the real .catch() in fetchAllAggregation to fire → RECEIVE_AGGREGATIONS_ERROR is committed with real conditions.
  • Before the fix: Language section vanishes entirely, no alert. After the fix: alert appears.

Screenshot

Before After
Screenshot_2026-09-08_at_15.48.00 Screenshot_2026-09-08_at_15.44.34

The first was confirmed to fail before the fix, which is what established that the alert was genuinely unreachable rather than merely untested.

Edited by Ravi Kumar

Merge request reports

Loading
Loading