Skip to content

Conversation

@JorgeEscire
Copy link

References

Fixes #3572

Description

Removes hardcoded default initialization to 'author' browse index that caused unnecessary failed requests when visiting browse-by pages on systems where the 'author' index is disabled.

Instructions for Reviewers

List of changes in this PR:

  • Removed hardcoded 'author' default from BrowseByMetadataComponent - the component now waits for route parameters before initializing browse requests
  • Updated BrowseByDateComponent.ngOnInit() to properly use browse ID from route parameters instead of relying on parent's default
  • Updated BrowseByTitleComponent.ngOnInit() to properly use browse ID from route parameters instead of relying on parent's default
  • Fixed BrowseByDateComponent test spy to expect 'dateissued' instead of 'author'
  • Improved loading state handling - loading$ properly initialized to show loading indicator while waiting for route parameters

Technical Details:

Before this fix:

  • BrowseByMetadataComponent initialized with a hardcoded request to 'author' browse index
  • When visiting any browse-by page (title, date, subject, etc.), two requests were made:
    1. First to /api/discover/browses/author/entries (unnecessary and would fail if disabled)
    2. Then to the correct browse index (e.g., /api/discover/browses/title/entries)

After this fix:

  • Components wait for route parameters to be available
  • Only one request is made to the correct browse index
  • browseEntries$ remains undefined until properly initialized
  • Loading indicator displays while parameters are being resolved

How to test this PR:

  1. Start the application: npm start:dev
  2. Open browser DevTools (F12) → Network tab
  3. Filter by XHR/Fetch requests
  4. Visit different browse-by pages:

Expected behavior:

  • Only ONE request should be made to the correct browse index
  • NO request should be made to /api/discover/browses/author/entries
  • Loading indicator should display briefly while route parameters are resolved
  • Page should load successfully without errors

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR fixes an issue ticket, I've linked them together.

@lgeggleston lgeggleston added bug component: Discovery related to discovery search or browse system 1 APPROVAL pull request only requires a single approval to merge labels Feb 10, 2026
@lgeggleston lgeggleston moved this to 🙋 Needs Reviewers Assigned in DSpace 10.0 Release Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge bug component: Discovery related to discovery search or browse system

Projects

Status: 🙋 Needs Reviewers Assigned

Development

Successfully merging this pull request may close these issues.

Browse-by pages produce failing request when REST doesn't support "author" browse

3 participants