Fix TypeError in EE BlobOverflowMenu when Apollo query errors

What does this MR do and why?

this MR fixes two issues that generates sentry error in ee/app/assets/javascripts/repository/components/header_area/blob_overflow_menu.vue:

  1. add missing i18n option that fixes TypeError: Cannot read properties of undefined (reading 'fetchError')
  2. add fallback value for the same query's update() hook

References

Screenshots or screen recordings

No UI change — this only affects the error alert message text when the GraphQL query fails.

Before After
TypeError: Cannot read properties of undefined (reading 'fetchError') thrown, no alert shown Alert shown with correct message: "An error occurred while fetching lock information, please try again."

How to set up and validate locally

  1. Navigate to any blob page on a GitLab EE instance (e.g. https://gitlab.com/git-scm/git/-/blob/main/blob.h)
  2. Simulate a GraphQL failure for getProjectInfoEE (e.g. via network throttling or a mock)
  3. Before fix: a JS TypeError is thrown in the console, no alert is shown
  4. After fix: an alert banner appears with the fetch error message
  5. Run the unit tests:
yarn jest ee/spec/frontend/repository/components/header_area/blob_overflow_menu_spec.js

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Chaoyue Zhao

Merge request reports

Loading
Loading