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-07-03 16:56:03 +00:00
2026-04-20 18:55:06 +00:00
2026-04-20 18:55:06 +00:00
2026-07-07 11:38:33 +02:00
2026-07-03 16:56:03 +00:00
2026-07-03 16:56:03 +00:00
2026-07-03 16:56:03 +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-05-01 14:44:10 +00: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-06-09 20:13:02 +00:00
2026-05-20 21:02:14 +00:00
2026-05-20 21:02:14 +00: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-07-03 23:18:00 +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-07 11:57:04 +00:00
2026-07-30 12:03:30 +02:00
2026-05-31 15:27:44 +02:00
2026-06-05 09:17:25 +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-18 16:38:00 +00:00
2026-06-02 11:55:25 +00:00
2026-07-07 11:38:33 +02:00
2026-06-08 13:54:09 +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-05-15 17:25:09 +02:00
2026-07-29 07:58:17 +00:00
2026-06-29 17:18:05 +02:00
2026-06-19 10:15:58 +02: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-04-20 18:55:06 +00:00
2026-07-29 22:53:46 +02:00
2026-08-20 11:58:06 +02:00
2026-04-20 18:55:06 +00:00
2026-06-18 20:57:05 +00: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-06-08 13:54:09 +00:00
2026-07-29 07:33:35 +00:00
2026-07-29 22:28:31 +02:00
2026-06-18 20:57:05 +00:00
2026-06-18 20:57:05 +00: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-06 15:45:55 +00: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-06-12 08:56:08 +00:00
2026-06-03 19:57:26 +00:00
2026-07-07 11:57:04 +00:00
2026-07-07 11:57:04 +00:00
2026-08-20 11:58:06 +02:00
2026-08-20 11:58:06 +02:00
2026-07-03 19:58:39 +02:00
2026-08-02 16:21:50 +02:00
2026-06-09 20:42:00 +00:00
2026-08-18 16:38:00 +00:00
2026-08-18 16:38:00 +00:00
2026-06-17 21:16:41 +00:00
2026-07-06 15:45:55 +00:00
2026-07-19 14:16:07 +00:00
2026-07-19 18:59:34 +02:00
2026-05-31 12:56:57 +00: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-06-18 20:57:05 +00: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-07 11:38:33 +02:00
2026-06-12 08:56:08 +00:00
2026-06-08 13:54:09 +00:00
2026-07-29 07:33:35 +00:00
2026-07-19 18:59:34 +02:00
2026-05-01 14:44:10 +00:00
2026-07-19 18:59:34 +02:00
2026-07-02 19:39:00 +02:00
2026-06-18 20:57:05 +00: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