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

GQL-85: Cannot view collection when a revision doesn't have UMM #146

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mandyparson
Copy link
Contributor

@mandyparson mandyparson commented Nov 13, 2024

Overview

What is the feature?

Users are unable to view C1000000321-SEDAC in production. It comes back with a "TypeError: Cannot read properties of undefined (reading 'ArchiveAndDistributionInformation')"

What is the Solution?

This happens we getCollection calls revisions and tries to read the umm of each revision. In the case of deleted revisions, there is no umm. So I created a default for the umm of a revision.

What areas of the application does this impact?

collection.js under concepts

Testing

Reproduction steps

  1. Point cmr-graphql to UAT
  2. Use reference picture below to set up a graphql query. Test it on main to see TypeError, then test on branch to see that it returns.

Attachments

On main
Screenshot 2024-11-13 at 1 18 35 PM

On branch
Screenshot 2024-11-13 at 1 19 08 PM

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

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (165e167) to head (9be4310).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #146   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          106       106           
  Lines         2410      2410           
  Branches       273       274    +1     
=========================================
  Hits          2410      2410           

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

@eudoroolivares2016
Copy link
Contributor

nitpick; we should change the name of the PR and maybe the ticket to be more specific to what the problem is. Just having the concept-id doesn't make it very clear of why theres a problem or what should be fixed

Perhaps something like GQL-85: Ensure that default case is handle for missing ArchiveAndDistributionInformation field

@mandyparson mandyparson changed the title GQL-85: Cannot view collection metadata C1000000321-SEDAC in MMT "All Collections" GQL-85: Cannot view collection when a revision doesn't have UMM Nov 14, 2024
@@ -277,7 +277,8 @@ describe('Collection', () => {
meta: {
'concept-id': 'C100000-EDSC',
'native-id': 'test-guid',
'revision-id': '2'
'revision-id': '3',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these changes to the mocks should be removed unless you plan to add a specific test to do something with the "deleted" mock you added.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The deleted mock shows that the whole call doesn't break when umm does not exist. Without adding these line 337 isn't fully tested

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