Say what actually happened when the REST API reduces a page size - #1448
Merged
milanmajchrak merged 1 commit intoAug 11, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refines the console warning emitted by ensureSelfLink so that when the only mismatch is the REST API capping a requested size parameter to a smaller value, the warning explains that the caller requested an unservable page size rather than implying an endpoint problem.
Changes:
- Add URL parsing helpers to detect when the self link differs solely due to a reduced
sizeparameter. - Introduce a dedicated warning message for “requested page size reduced by REST API” cases; otherwise keep the existing generic warning.
- Extend unit tests to cover the new reduced-page-size warning behavior and fallback scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/app/core/data/dspace-rest-response-parsing.service.ts |
Adds page-size extraction and conditional warning generation for reduced page-size self link mismatches. |
src/app/core/data/dspace-rest-response-parsing.service.spec.ts |
Updates specs to assert the new reduced-page-size warning and verify fallback to the generic warning. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
milanmajchrak
force-pushed
the
fix/862-specific-page-size-warning-jcu
branch
from
August 11, 2026 07:09
3f0664d to
83f840d
Compare
The generic wording ends with "This could mean there's an issue with the REST endpoint", which points at the backend. For a reduced page size that is the wrong place to look: the API did nothing wrong, the caller asked for a bigger page than it will serve. 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 Anything else keeps the generic message, including a page that came back larger than requested. Also drops a stray note from the spec that was left in by #1440. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
milanmajchrak
force-pushed
the
fix/862-specific-page-size-warning-jcu
branch
from
August 11, 2026 07:20
83f840d to
bdd533a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References
Description
After #1440 one self link warning is still reported on purpose: a caller asking for a page size the REST API won't serve. The generic message blames the endpoint, which is wrong for that case, so it gets its own.
Instructions for Reviewers
Before:
After:
Only when the page size is the only difference and the served one is smaller. Everything else keeps the generic message.
How to test: set an
elementsPerPageabove 1000 somewhere, load the page, read the console.Checklist
customer/jcu, notmain.