Skip to content

fix(support): drop recommendation edges pointing beyond the graph node cap#3917

Closed
TaprootFreak wants to merge 1 commit into
feat/support-referral-network-usedreffrom
fix/support-recommendation-graph-dangling-edges
Closed

fix(support): drop recommendation edges pointing beyond the graph node cap#3917
TaprootFreak wants to merge 1 commit into
feat/support-referral-network-usedreffrom
fix/support-recommendation-graph-dangling-edges

Conversation

@TaprootFreak

Copy link
Copy Markdown
Collaborator

Problem

getRecommendationGraph caps the BFS at MAX_NODES (500). Ref-code (UsedRef) edges are already filtered to endpoints contained in visitedUsers, but recommendation edges are not. When the cap is reached, a recommendation edge can reference a node that was queued but never loaded, so the response contains edges pointing to nodes that are absent from nodes[]. The graph screen drops those edges silently and its edge counter over-reports (edges.length vs. rendered).

Fix

Apply the same visitedUsers membership guard to recommendation edges that the ref-code edges already use. Minimal, consistent with the existing pattern, no DTO/contract change.

Verification (real data, userDataId 321067)

  • Before: 70 dangling recommendation edges; API edgeCount 584; frontend rendered 514.
  • After: 0 dangling; edgeCount 514 == rendered edges; node cap (500), dedup, ref-code edges, panel and navigation all unchanged.
  • prettier, eslint, build green.

Targets the #3897 feature branch so the fix folds into that PR.

@TaprootFreak

Copy link
Copy Markdown
Collaborator Author

Superseded by the consolidated #3948 (now targets develop and includes this fix).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant