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

Fix submission lost changes after save #2962

Merged

Conversation

artlowel
Copy link
Member

References

Description

This embeds the item in the PATCH request when saving the submission. This ensures cached item and workspace item don't go out of sync. It solved an issue I had with one particular DSpace on 7.6 where the metadata seemed to disappear when you saved the submission form, but reappeared after a refresh.

I can't reproduce #2940, but I suspect it may have a similar cause

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • 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 yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn 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.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

…mission form would revert to the previous data on save
…es-after-save-7.6' into fix-submission-lost-changes-after-save-8.0.0-next
@artlowel artlowel requested a review from tdonohue April 19, 2024 16:09
@artlowel artlowel requested a review from kshepherd April 19, 2024 16:09
@tdonohue tdonohue added bug 1 APPROVAL pull request only requires a single approval to merge component: submission labels Apr 19, 2024
@tdonohue tdonohue added this to the 8.0 milestone Apr 19, 2024
@kshepherd
Copy link
Member

I can confirm that this change seemed to stabilise patch ops and uploads in item submission, though I didn't catch the issue @tdonohue brought up.. that could be making all our patch ops unnecessarily large I guess, or even invalid if they don't apply to items?

Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks @artlowel ! This looks good to me. I'm having difficulty reproducing the original bug anymore, but this PR seems like it does improve things. Code looks good too

@tdonohue tdonohue merged commit 288a918 into DSpace:main Apr 24, 2024
13 checks passed
@tdonohue
Copy link
Member

Manually ported to 7.x in #3053

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

Successfully merging this pull request may close these issues.

Editing an in-progress submission results in an empty form
3 participants