Commit e4df152
fix(teams): Deduplicate project features list (#112326)
When a project belongs to multiple teams, the team serializer was
building the projects list from the ProjectTeam join table without
deduplicating. This meant `get_features_for_projects()` iterated the
same project N times (once per team it belongs to), appending features
to the same list each time. The features array in the response ended up
with N copies of every feature.
Deduplicates the project list before passing it to `serialize()`.
You can see duplicates in the production endpoint
https://us.sentry.io/api/0/organizations/sentry/teams/
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 1e5cf9d commit e4df152
File tree
2 files changed
+17
-1
lines changed- src/sentry/api/serializers/models
- tests/sentry/api/serializers
2 files changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
253 | 255 | | |
254 | 256 | | |
255 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
280 | 294 | | |
281 | 295 | | |
282 | 296 | | |
| |||
0 commit comments