Commit deaba3c
authored
fix: only generate links when fields expand to href [DHIS2-21856] (2.43) (#24501)
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 31819c1 commit deaba3c
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 | |
|---|---|---|---|
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
545 | | - | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
546 | 552 | | |
547 | 553 | | |
548 | 554 | | |
| |||
0 commit comments