Create intermediate user for channels #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
We sort channels by membership here, which looks at the membership from the slack channel and we append that to the private channels.
Then inside of the TransformChannels function we add the
P
type ONLY if it has > 8 valid members, here. Which in my case, not all of these channels do have valid members so that check then fails.Then to complicate the issue, the user is created at the very end as
deleted user
because they own a post. So, we have these users that own posts in channels, but they're not channel members and contain no membership except town-square.The PR here might not have a perfect solution. However, I can confirm it resolves the problem within the import and no more channels are imported as type
G
, and all users (even invalid users) are now properly added to the channel membership.