Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submission Form should be loaded using fewer REST requests #3162

Open
tdonohue opened this issue Jul 3, 2024 · 3 comments
Open

Submission Form should be loaded using fewer REST requests #3162

tdonohue opened this issue Jul 3, 2024 · 3 comments
Assignees
Labels
affects: 7.x Issue impacts 7.x releases affects: 8.x Issue impacts 8.x releases bug claimed: 4Science 4Science team is working on this issue & will contribute back component: submission performance / caching Related to performance, caching or embedded objects

Comments

@tdonohue
Copy link
Member

tdonohue commented Jul 3, 2024

Describe the bug

In 7.x and 8.x, when a user starts a new submission, this makes ~9 calls to the REST API to load all the required information to create the Submission form. First, the WorkspaceItem is loaded, then each section of the form (one by one), then any controlled vocabularies (one by one).

Here's an example of what you see in Chrome DevTools when the Submission Form loads:

# Load WorkspaceItem
GET /server/api/submission/workspaceitems/[:id]?embed=item,sections,collection

# Load each section of form one by one
GET /server/api/config/submissionforms/traditionalpageone
GET /server/api/config/submissionforms/traditionalpagetwo
GET /server/api/config/submissionforms/upload?embed=metadata
GET /server/api/config/submissionforms/license

# Load any referenced controlled vocabularies (to populate dropdowns, etc)
GET /server/api/submission/vocabularies/common_types
GET /server/api/submission/vocabularies/common_iso_languages

# Finally, load the *entry* values in those controlled vocabularies (as a separate request)
GET /server/api/submission/vocabularies/common_types/entries?page=0&size=10
GET /server/api/submission/vocabularies/common_iso_types/entries?page=0&size=10

Ideally, it'd be better to see if we can load all this information in a single request (or at least fewer requests) by better usage of Projections (embed param)

To Reproduce

Steps to reproduce the behavior:

  1. Login to demo.dspace.org or sandbox.dspace.org
  2. Open Chrome DevTools
  3. Create a new Submission. Verify that you see roughly 8-10 requests to build the submission form.

Expected behavior

Ideally, better usage of projections should allow us to load all this information in fewer REST requests. If additional endpoints need to be added to the REST API to support this behavior, then we should add them.

@GraziaQuercia
Copy link

Hi @tdonohue, we'd like to have this issue assigned to 4Science, @atarix83 can be the Assignee. Thanks!

@kshepherd
Copy link
Member

A note here that since "replace Submission Form library" is also on the 9.0 TODO list, it should be coordinated with this so we don't accidentally do any work that has to be thrown away or replaced ;)

@tdonohue
Copy link
Member Author

Thanks @GraziaQuercia ! I'll assign @atarix83 to this then.

I do also want to call out @kshepherd 's note above that this might be semi-related to #2216 (the ticket about replacing the submission form library). I'm not sure myself whether these two tickets are connected. But, if 4Science finds they are connected, definitely let us know. My current suspicion is that better usage of Projections (embed param) may be a possible solution to this ticket...and that approach may not touch the submission form library (ng-dynamic-forms) directly. Nonetheless, I agree with @kshepherd that we don't want to build something complex that needs to be immediately replaced.

@tdonohue tdonohue added the claimed: 4Science 4Science team is working on this issue & will contribute back label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: 7.x Issue impacts 7.x releases affects: 8.x Issue impacts 8.x releases bug claimed: 4Science 4Science team is working on this issue & will contribute back component: submission performance / caching Related to performance, caching or embedded objects
Projects
Status: 🏗 In Progress
Development

No branches or pull requests

4 participants