-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: empty discussion stages #10836
base: master
Are you sure you want to change the base?
fix: empty discussion stages #10836
Conversation
const groupReflectionCounts = reflections.reduce((counts: Record<string, number>, reflection) => { | ||
counts[reflection.reflectionGroupId] = (counts[reflection.reflectionGroupId] || 0) + 1 | ||
return counts | ||
}, {}) | ||
|
||
const activeGroups = reflectionGroups.filter( | ||
(group) => (groupReflectionCounts[group.id] ?? 0) > 0 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1 we already call removeEmptyReflections
in handleCompletedRetrospectiveStage
,
const data: Record<string, any> = await removeEmptyReflections(meeting, dataLoader) |
We should also remove empty reflection groups there, i.e. set them to
isActive: false
.Otherwise if we cannot rely on this field being accurate when calling the
retroReflectionGroupsByMeetingId
loader, then we should get rid of the field completely and modify the loader to do a join with reflections to check there are some in the group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, makes sense. I've updated removeEmptyReflections
to set reflection groups to be inactive if they don't contact any reflections
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we still need this logic here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, removed!
const groupReflectionCounts = reflections.reduce((counts: Record<string, number>, reflection) => { | ||
counts[reflection.reflectionGroupId] = (counts[reflection.reflectionGroupId] || 0) + 1 | ||
return counts | ||
}, {}) | ||
|
||
const activeGroups = reflectionGroups.filter( | ||
(group) => (groupReflectionCounts[group.id] ?? 0) > 0 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we still need this logic here?
Fix #10799
Demo: https://www.loom.com/share/ed780b147c314f5ea88bcf632441ed7c
To test