[SST-15759] convert member list ids to integers #20
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.
Why?
The current procedure for adding members to a group is wrong.
What it did prior to this PR is that it would create an array containing the IDs of the members to be added to the group, and then the IDs of members already belonging to the group would be filtered out of that array. The line of code that accomplishes essentially does
new_member_ids = new_member_ids - existing_member_ids. The problem is that at the moment,new_member_idscan be an array of either ints or strings, whileexisting_member_idsis always an array of ints. In the event thatnew_member_idsis an array of strings, the members may be still be added to the group even though they should be filtered out.What?
Convert
new_member_idsto an array of ints before filtering, such that existing IDs will filtered out regardless of the type.