Pick the member branch by list contents so add_members is not treated as a removal - #59
Open
gpunto wants to merge 1 commit into
Open
Pick the member branch by list contents so add_members is not treated as a removal#59gpunto wants to merge 1 commit into
gpunto wants to merge 1 commit into
Conversation
gpunto
force-pushed
the
fix/pick-member-branch-by-list-contents
branch
from
August 17, 2026 12:19
a9d39f8 to
20e44c2
Compare
gpunto
marked this pull request as ready for review
August 18, 2026 12:34
gpunto
enabled auto-merge (squash)
August 18, 2026 12:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🔗 Issue Links
No tracking issue.
update_memberspicks the add/remove branch by whetherremove_membersis present, but an empty arrayis truthy in Ruby:
Clients generated from the OpenAPI models send every action list on every call, so an
add_membersrequest arrives carrying
"remove_members":[]. The helper then takes the remove branch, ignoresadd_members, and broadcasts nomember.addedevent.The fix picks the branch by whether the list has entries, and defaults
member_idsto an empty list so abody that omits both keys no longer raises
NoMethodErroronnil.each.Behaviour per payload shape, old vs new:
add_members:["jc"], remove_members:[]REMOVE, []ADD, ["jc"]add_members:[], remove_members:["jc"]REMOVE, ["jc"]add_members:[], remove_members:[]REMOVE, []ADD, [](no-op either way)add_members:["jc"](no remove key)ADD, ["jc"]remove_members:["jc"](no add key)REMOVE, ["jc"]{}ADD, nilthen raisesADD, []Only the first and last rows change, so bodies from the current clients keep their existing behaviour.
🧪 Testing Notes
Verified the branch selection for each shape above against both the old and the new expression. No E2E test
adds a member from the app today, which is why this has been invisible; the fix is what makes such a test
possible.
Please verify the E2E test runs: