Commit 016eb00
committed
fix: only generate links when fields expand to href [DHIS2-21856] (2.42)
Single-object GET treated any field preset (e.g. :owner) as if href was
requested, triggering deep link generation that reflectively initializes
every lazy collection of the entity. On objects with very large
collections (e.g. a user role with 240k members) this loads and
L2-caches every member entity, taking 30+ seconds of CPU per request.
Only *, :all and :simple actually expand to the transient href property,
so only those (and a literal href field) now trigger link generation.
Response payloads are unchanged for all field values.
AI Assisted1 parent e8d9886 commit 016eb00
2 files changed
Lines changed: 32 additions & 2 deletions
File tree
- dhis-2
- dhis-test-web-api/src/test/java/org/hisp/dhis/webapi/controller
- dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| |||
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
108 | 132 | | |
109 | 133 | | |
110 | 134 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
539 | | - | |
540 | | - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
541 | 547 | | |
542 | 548 | | |
543 | 549 | | |
| |||
0 commit comments