Skip to content
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

Merged
merged 5 commits into from
Apr 20, 2023
Merged

Allow excluding people in large groups #93

merged 5 commits into from
Apr 20, 2023

Conversation

Powersource
Copy link
Collaborator

Fixes #70

@socket-security
Copy link

New dependency changes detected. Learn more about Socket for GitHub ↗︎


👍 No new dependency issues detected in pull request

Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

Pull request alert summary
Issue Status
Install scripts ✅ 0 issues
Native code ✅ 0 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Deprecated license ✅ 0 issues
Missing license ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues

📊 Modified Dependency Overview:

➕ Added Package Capability Access +/- Transitive Count Publisher
lodash.chunk@4.2.0 None +0 jdalton

@Powersource Powersource marked this pull request as ready for review April 14, 2023 18:03
@mixmix
Copy link
Member

mixmix commented Apr 18, 2023

reviewing now

index.js Outdated
Comment on lines 250 to 259
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()
})
Copy link
Member

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)
Suggested change
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()
})
})

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

Copy link
Member

@mixmix mixmix left a 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

@Powersource Powersource requested a review from mixmix April 19, 2023 12:38
@mixmix mixmix removed request for staltz and arj03 April 20, 2023 02:08
Copy link
Member

@mixmix mixmix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MERGE 📯

@Powersource Powersource merged commit cf93ac5 into master Apr 20, 2023
@Powersource Powersource deleted the loop-readd branch April 20, 2023 15:24
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.

Loop member re-addition on exclusion
2 participants