-
Notifications
You must be signed in to change notification settings - Fork 1
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
Allow excluding people in large groups #93
Conversation
New dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No new dependency issues detected in pull request Bot CommandsTo ignore an alert, reply with a comment starting with Pull request alert summary
📊 Modified Dependency Overview:
|
reviewing now |
index.js
Outdated
const done = multicb() | ||
chunk(remainingMembers, 15).forEach((membersToAdd) => { | ||
addMembers(groupId, membersToAdd, {}, done()) | ||
}) | ||
done((err) => { | ||
// prettier-ignore | ||
if (err) return cb(clarify(err, "Couldn't re-add remaining members when excluding members")) | ||
|
||
return cb() | ||
}) |
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.
We can do this will pull-streams. This has a couple advantages:
- we aren't introducing an new module
- we can control the rate of publishing of these messages (yours could try publishing a lot of messages all at once and trigger a lot of tangle calculations in parallel)
const done = multicb() | |
chunk(remainingMembers, 15).forEach((membersToAdd) => { | |
addMembers(groupId, membersToAdd, {}, done()) | |
}) | |
done((err) => { | |
// prettier-ignore | |
if (err) return cb(clarify(err, "Couldn't re-add remaining members when excluding members")) | |
return cb() | |
}) | |
pull( | |
pull.values(chunk(remainingMembers, 15)), | |
pull.asyncMap((members, cb) => addMembers(groupId, members, {}, cb)), | |
pull.collect((err) => { | |
// prettier-ignore | |
if (err) return cb(clarify(err, "Couldn't re-add remaining members when excluding members")) | |
return cb() | |
}) | |
}) |
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.
done!
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.
yeah I feel fairly strongly about wanting the recommended change
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.
MERGE 📯
Fixes #70