Commit 52acd99
Port #1490 to dtq-dev-9-base: fix(self-link): say what happened when the API reduces a page size
ensureSelfLink() logs one wording for every self link that differs from the url it
was requested with, and that wording ends with "This could mean there's an issue
with the REST endpoint". For a page size the API reduced, that points at the wrong
place: the API did exactly what its contract says, the caller asked for a bigger
page than it will ever serve. Whoever reads the console goes looking at the
backend for a frontend mistake.
Give that case its own message:
The request for '.../bundles?size=9999' asked for a page of 9999 elements, but
the REST API served 1000. Ask for at most MAX_PAGE_SIZE elements
It applies only when the two urls are otherwise identical, so an accepted
reduction cannot mask a wrong page or sort. Anything else keeps the generic
message, including a page that came back larger than requested.
- dspace-rest-response-parsing.service.ts: isUnexpectedSelfLink() is replaced by
selfLinkWarning(), which returns the message to log or undefined when there is
nothing to report, plus the getPageSize()/withoutPageSize() helpers and the
PAGE_SIZE_PARAM they match on. The self link is normalized either way, as
before, so the url a response is cached under does not change - only whether and
how we warn.
- dspace-rest-response-parsing.service.spec.ts: 17 cases to 19. The reduced page
size case now expects the specific wording; one new case pins that a reduced
size is recognised alongside other params, another that a page differing as well
falls back to the generic message. It also drops a stray note left in the spec
by #1415.
v9 notes: this is the 9.3-native original (customer/jcu 382a721) applied
unchanged. Its two files were byte-identical with this branch after #1415, so the
cherry-pick was clean, and its changed lines are identical to those of the dtq-dev
commit 51796ec (the two differ only in the untouched import block's formatting).
Stacked on ufal/port-1415-9-base (card FE-06 / PR #1415) - #1490 rewrites the
helper that #1415 introduces.
Card FE-01 (tranche T1).
Source: 51796ec (dtq-dev PR #1490)
Adapted-from: 382a721 (customer/jcu PR #1448)
(cherry picked from commit 382a721)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 2233470 commit 52acd99
2 files changed
Lines changed: 64 additions & 23 deletions
File tree
- src/app/core/data
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | | - | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 103 | + | |
106 | 104 | | |
107 | 105 | | |
108 | 106 | | |
109 | 107 | | |
110 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
111 | 127 | | |
112 | 128 | | |
113 | 129 | | |
114 | 130 | | |
115 | | - | |
| 131 | + | |
116 | 132 | | |
117 | 133 | | |
118 | 134 | | |
| |||
Lines changed: 43 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
| |||
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
77 | | - | |
78 | | - | |
| 82 | + | |
| 83 | + | |
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
| |||
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
99 | 106 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
105 | 129 | | |
106 | 130 | | |
107 | 131 | | |
| |||
210 | 234 | | |
211 | 235 | | |
212 | 236 | | |
213 | | - | |
214 | | - | |
215 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
216 | 241 | | |
217 | 242 | | |
218 | 243 | | |
| |||
0 commit comments