Skip to content

[Bug] IssueDetailPage: Comments fetched without issueId filter (performance) #119

@mpaulosky

Description

@mpaulosky

Summary

IssueDetailPage.razor calls CommentClient.GetAllAsync() without passing the current issueId. This causes all comments for all issues to be fetched from the API and then filtered client-side with .Where(c => c.Issue.Id.ToString() == Id).

Root Cause

// IssueDetailPage.razor — LoadData()
_comments = await CommentClient.GetAllAsync();
_comments = _comments?.Where(c => c.Issue.Id.ToString() == Id).ToList();

CommentApiClient.GetAllAsync(string? issueId = null) already has the optional issueId parameter — it's just not being passed.

Fix

_comments = await CommentClient.GetAllAsync(issueId: Id);
// No client-side filter needed after this

Impact

  • Every issue detail page load fetches the entire comments collection from MongoDB
  • Gets progressively slower as the total comment count grows
  • Unnecessary data transfer over the wire

Acceptance Criteria

  • CommentClient.GetAllAsync(Id) is called with the issue ID
  • Client-side .Where() filter is removed (server does the filtering)
  • Comment section still loads and shows correctly for the current issue only
  • No comments from other issues appear

Files

  • src/Web/Components/Features/Issues/IssueDetailPage.razor
  • src/Web/Components/Features/Comments/CommentApiClient.cs (verify param name)

Metadata

Metadata

Labels

go:yesReady to implementpriority:p2Next sprintrelease:backlogNot yet targetedsprint-3Sprint 3 — Full CRUD UI + ArchivesquadSquad triage inbox — Lead will assign to a membersquad:legolasAssigned to Legolas (Frontend Dev)type:bugSomething broken

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions