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

Ensure item is also embedded in submission form #3016

Merged
merged 1 commit into from
May 7, 2024

Conversation

tdonohue
Copy link
Member

@tdonohue tdonohue commented May 7, 2024

References

Description

On main and dspace-7_x after #2988 was merged, the submission e2e tests began to fail (almost randomly).

After digging into the issue locally, I found the cause was that the Submission Form would occasionally hang indefinitely at a "Loading ..." page. After testing locally, I found I was able to reproduce that on my local machine via the following steps:

  1. Start the UI in production mode (yarn build:prod; yarn serve:ssr). Might also be reproducible in dev mode.
  2. Login and visit any "In Progress Submission" (i.e. WorkspaceItem) from MyDSpace
  3. While the submission form is visible, click the reload button in your browser several times.
  4. Eventually (sometimes on first reload) you'll find the form will hang with a "Loading ... " message. It will no longer be possible to see the form unless you leave the page and go back via MyDSpace
  5. If you look in your DevTools Console, you'll see this error like this has occurred:
main.js:23 ERROR TypeError: Cannot read properties of undefined (reading 'metadata')
    at main.js:1:1340638
    at Array.forEach (<anonymous>)
    at main.js:1:1340091
    at main.js:1:2010833
    at c._next (main.js:1:2007228)
    at c.next (main.js:1:1996090)
    at main.js:1:2009564
    at c._next (main.js:1:2007228)
    at c.next (main.js:1:1996090)
    at main.js:1:1994053

After debugging the issue, I found the line producing this error is here:
https://github.com/DSpace/dspace-angular/blob/main/src/app/submission/objects/submission-objects.effects.ts#L108

The error appears to be that the Submission form will somehow "lose access" to the item object (similar to described in #2940 and fixed by #2962)

This PR fixes the issue by updating the newly added code in #2988 to also embed the item object.

Instructions for Reviewers

  • This should allow e2e tests to succeed again, as the failures in the submission.cy.ts e2e tests are a side effect of this bug.

@tdonohue tdonohue added bug component: submission high priority 1 APPROVAL pull request only requires a single approval to merge port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release labels May 7, 2024
@tdonohue tdonohue added this to the 8.0 milestone May 7, 2024
@tdonohue tdonohue changed the title Ensure item is also embedded in submission form Ensure item is also embedded in submission form May 7, 2024
@tdonohue
Copy link
Member Author

tdonohue commented May 7, 2024

As this bug is effecting the e2e tests of all PRs, I'm going to merge this immediately. If further changes are needed, we can add them in follow-up PRs.

@tdonohue tdonohue merged commit 2215f5f into DSpace:main May 7, 2024
13 checks passed
@dspace-bot
Copy link
Contributor

Successfully created backport PR for dspace-7_x:

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: submission high priority
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants