Loading
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:
- add missing
i18noption that fixesTypeError: Cannot read properties of undefined (reading 'fetchError') - add fallback value for the same query's
update()hook
References
- Sentry issue: https://new-sentry.gitlab.net/organizations/gitlab/issues/3882971/
- GitLab issue: https://gitlab.com/gitlab-org/gitlab/-/work_items/625055
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
- Navigate to any blob page on a GitLab EE instance (e.g.
https://gitlab.com/git-scm/git/-/blob/main/blob.h) - Simulate a GraphQL failure for
getProjectInfoEE(e.g. via network throttling or a mock) - Before fix: a JS TypeError is thrown in the console, no alert is shown
- After fix: an alert banner appears with the fetch error message
- Run the unit tests:
yarn jest ee/spec/frontend/repository/components/header_area/blob_overflow_menu_spec.jsMR 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