legacyViewerLoaded not updated for BLAME_VIEWER type
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
The legacyViewerLoaded computed property in app/assets/javascripts/repository/components/blob_content_viewer.vue does not account for BLAME_VIEWER, only checking SIMPLE_BLOB_VIEWER and RICH_BLOB_VIEWER:
legacyViewerLoaded() {
return (
(this.activeViewerType === SIMPLE_BLOB_VIEWER && this.legacySimpleViewer) ||
(this.activeViewerType === RICH_BLOB_VIEWER && this.legacyRichViewer)
);
},This was pre-existing but became observable after !244836 (merged) fixed inline blame for legacy files.
Potential consequences
- Duplicate fetches: The early-return guard in
loadLegacyViewer(if (this.legacyViewerLoaded || this.isLoadingLegacyViewer) return;) won't prevent a re-fetch after the first request completes, sinceisLoadingLegacyVieweris reset tofalsein.finally()andlegacyViewerLoadedremainsfalse. CodeIntelligencewon't render: The template conditionv-if="blobViewer || legacyViewerLoaded"on<code-intelligence>will remainfalse, so code navigation won't activate for blame on legacy files.
Proposed fix
Add (this.activeViewerType === BLAME_VIEWER && this.legacySimpleViewer) to the legacyViewerLoaded computed property.
References
Edited by 🤖 GitLab Bot 🤖