[FIX] Revert breaking change to groups.list API: 404 vs. empty list
The commit 21b81e9a9 "Chore: Update Meteor 2.7.3 (#25991)" introduced a breaking change to two API endpoints, incidental to the task of updating Meteor.
- /api/v1/groups.list
- /api/v1/channels.list.joined
These two endpoints return the list of rooms a user is a member of. If the user is not a member of any room, it used to return an empty list, that is
{groups: [], total: 0}
RC v5.0.0 changed that behavior to return 404, which raises an exception in the wrapper library (as it should).
Requesting the list of private group memberships of a user who is not a member of any private groups should properly return an empty list, exactly as it used to. It is normal, not exceptional, for a user not to be a member of any private groups. An example of an appropriate use of HTTP status code 404 would be if we requested the list of private groups of a user who doesn’t exist.
Proposed changes (including videos or screenshots)
API calls that request a list of groups which meet some criteria should return an empty list when appropriate, rather than 404. This was the pre-v5.0.0 behavior.
Special Note
- This PR is a duplicate of #27137 but is on a personal repo (vs. corporate), so that I can "Allow edits by maintainers"
- On that other PR, you asked for additional test specs. I am unable to do that right now (having trouble getting a local dev environment working on MacOS -- see Open RC thread) so I am opening this up for you to edit.