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

Mmt 3922: User is experiencing an issue with MMT deleting information added even after hitting "Save and Continue." #1313

Merged
merged 8 commits into from
Oct 22, 2024

Conversation

mandyparson
Copy link
Contributor

@mandyparson mandyparson commented Oct 17, 2024

Overview

What is the feature?

When users would click Save & Continue, occationaly an incorrect version of the draft would populate. This code triggers a useEffect if the revisionId that comes back from CMR does not match the revisionId that we expect.

What is the Solution?

Add revisionId to AppContextProvider and set it when a user ingests a draft. This triggers a change in the data which triggers a fetchdraft useeffect.

What areas of the application does this impact?

MetadataForm and AppContextProvider

Testing

Reproduction steps

  • **Environment for testing: UAT
  • **Collection to test with: Any new draft
  1. Insert the following below line 144 in MetadataForm.jsx in order to see what's going on in the useEffect:
    console.log("🚀 ~ useEffect ~ cmrRetrievedRevisionId:", cmrRetrievedRevisionId)
    console.log("🚀 ~ useEffect ~ appContextRevisionId:", appContextRevisionId)
  2. Create a new draft and click Save & Continue. It should work as expected.
  3. If doing this does not trigger an error notification at some point, you can force it to send out an error by changing line 239 from setRevisionId(savedRevisionId) to setRevisionId(1000). Or whatever unattainable number you so choose.

Attachments

Please include relevant screenshots or files that would be helpful in reviewing and verifying this change.

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@mandyparson mandyparson requested review from cgokey and htranho October 17, 2024 20:07
@codecov-commenter
Copy link

codecov-commenter commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.68%. Comparing base (3e13dba) to head (8917cfd).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1313   +/-   ##
=======================================
  Coverage   97.68%   97.68%           
=======================================
  Files         364      365    +1     
  Lines        5733     5740    +7     
  Branches     1202     1193    -9     
=======================================
+ Hits         5600     5607    +7     
  Misses        132      132           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mandyparson mandyparson merged commit e098588 into main Oct 22, 2024
5 of 7 checks passed
@mandyparson mandyparson deleted the MMT-3922 branch October 22, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants