emilsteixner and GitHub
112a807d7d
fix(teams): preserve members across list responses ( #3486 )
...
Fixes incomplete team `members` arrays when a user belongs to multiple
teams included in the same response.
`addMoreInfoToTeams` queried one row per `(team_id, user_id)` membership
but stored those rows in a map keyed only by user ID. When a user was a
member of multiple teams, a later row replaced an earlier one. The
subsequent member assignment loop therefore used only the surviving
membership row.
The fix stores all queried membership rows in a slice, preserving every
team-user relation. It creates a separate `usersByID` map only for
resolving `created_by`, where one row per user is appropriate.
This affects both list paths because both use `addMoreInfoToTeams`:
- `GET /api/v1/teams`
- `GET /api/v1/projects/{projectId}/teams`
2026-08-20 15:32:23 +00:00
..
2026-08-02 16:21:50 +02:00
2026-08-02 16:21:50 +02:00
2026-08-18 09:44:49 +02:00
2026-08-18 09:44:49 +02:00
2026-07-19 18:59:34 +02:00
2026-08-19 13:01:59 +02:00
2026-07-28 06:59:04 +00:00
2026-08-04 13:40:11 +02:00
2026-08-04 13:40:11 +02:00
2026-08-02 16:21:50 +02:00
2026-08-02 16:21:50 +02:00
2026-07-18 13:41:15 +00:00
2026-08-20 11:58:06 +02:00
2026-08-02 16:21:50 +02:00
2026-08-16 17:57:52 +02:00
2026-08-16 17:57:52 +02:00
2026-08-20 11:58:06 +02:00
2026-08-02 16:21:50 +02:00
2026-08-20 11:58:06 +02:00
2026-08-04 01:09:10 +02:00
2026-07-30 12:03:30 +02:00
2026-07-30 12:03:30 +02:00
2026-07-30 12:03:30 +02:00
2026-08-04 13:40:11 +02:00
2026-08-04 13:40:11 +02:00
2026-08-02 16:21:50 +02:00
2026-08-18 16:38:00 +00:00
2026-07-29 07:58:17 +00:00
2026-07-29 07:58:17 +00:00
2026-07-29 07:58:17 +00:00
2026-07-29 07:58:17 +00:00
2026-07-29 07:58:17 +00:00
2026-08-18 16:38:00 +00:00
2026-07-29 07:58:17 +00:00
2026-08-16 17:57:52 +02:00
2026-07-26 09:39:41 +00:00
2026-08-19 16:02:39 +02:00
2026-08-20 11:58:06 +02:00
2026-07-19 18:59:34 +02:00
2026-07-19 18:59:34 +02:00
2026-07-29 22:53:46 +02:00
2026-08-20 11:58:06 +02:00
2026-07-19 18:59:34 +02:00
2026-08-04 01:09:10 +02:00
2026-08-04 01:09:10 +02:00
2026-08-20 11:58:06 +02:00
2026-07-19 18:59:34 +02:00
2026-08-02 16:21:50 +02:00
2026-08-04 13:40:11 +02:00
2026-08-04 13:40:11 +02:00
2026-07-19 18:59:34 +02:00
2026-07-29 07:33:35 +00:00
2026-07-29 22:28:31 +02:00
2026-08-16 17:57:52 +02:00
2026-08-16 17:57:52 +02:00
2026-07-28 23:41:49 +02:00
2026-07-28 23:41:49 +02:00
2026-07-30 12:03:30 +02:00
2026-07-19 18:59:34 +02:00
2026-08-04 13:40:11 +02:00
2026-08-20 11:58:06 +02:00
2026-08-20 11:58:06 +02:00
2026-08-02 16:21:50 +02:00
2026-08-18 16:38:00 +00:00
2026-08-18 16:38:00 +00:00
2026-07-19 14:16:07 +00:00
2026-07-19 18:59:34 +02:00
2026-08-18 19:01:05 +02:00
2026-08-18 19:01:05 +02:00
2026-08-04 13:40:11 +02:00
2026-08-04 13:40:11 +02:00
2026-08-20 15:32:23 +00:00
2026-08-20 15:32:23 +00:00
2026-07-29 07:33:35 +00:00
2026-07-19 18:59:34 +02:00
2026-07-19 18:59:34 +02:00
2026-08-20 11:58:06 +02:00
2026-07-28 17:25:57 +02:00
2026-08-04 13:40:11 +02:00