docs/solutions/test-failures/2026-03-22-suggestion-descriptions-must-read-real-suggestion-metadata.md
getActiveSuggestionDescriptions looked covered, but the existing spec mocked the helper chain and hid a real runtime failure.
On a real editor, active suggestion descriptions could return the wrong userId, miss deletion text entirely, and fail to find sibling suggestion nodes for the same suggestion id.
Three helpers were built around fake assumptions instead of the stored suggestion shape:
getSuggestionNodeEntries matched n.suggestionId, but real inline suggestions are stored under dynamic keys like suggestion_<id>getSuggestionUserIds treated the dynamic key suffix as a user id, even though the suffix is the suggestion idgetActiveSuggestionDescriptions classified deletions from node.suggestionDeletion, but real suggestion type lives inside the stored metadata objectThe old mocked spec passed because it invented node shapes that matched those assumptions.
Make the helper chain read the real metadata shape:
const suggestionKey = getSuggestionKey(suggestionId);
const nodes = Array.from(getSuggestionNodeEntries(editor, suggestionId)).map(
([node]) => node
);
const insertions = nodes.filter(
(node: any) => node[suggestionKey]?.type === 'insert'
);
const deletions = nodes.filter(
(node: any) => node[suggestionKey]?.type === 'remove'
);
And fix the helpers below it:
getSuggestionNodeEntries matches by getSuggestionKey(suggestionId)getSuggestionUserIds reads userId from the stored suggestion datafindSuggestionProps checks the previous block line-break suggestion even when there is no nextPoint