GQL-138: Reverting revision does not work for some collections#178
Merged
mandyparson merged 8 commits intomainfrom Feb 10, 2026
Merged
GQL-138: Reverting revision does not work for some collections#178mandyparson merged 8 commits intomainfrom
mandyparson merged 8 commits intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #178 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 115 115
Lines 2694 2706 +12
Branches 328 330 +2
=========================================
+ Hits 2694 2706 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mandyparson
commented
Feb 6, 2026
|
|
||
| // First attempt: without Authorization | ||
| try { | ||
| previousRevisions = await cmrQuery({ |
Contributor
There was a problem hiding this comment.
Wouldn't we just pass the Auth header each time and if its empty the request should resolve? Seems like we'd want to leave that kind of thing to CMR API core to just return the things accessible to the client.
eudoroolivares2016
approved these changes
Feb 9, 2026
src/utils/findPreviousRevision.js
Outdated
|
|
||
| // Determine if revisionId requested still exists | ||
| // CMR only stores the ten most recent revisions | ||
| const mostRecentRevisionId = parseInt(responseItems[0].meta['revision-id'], 10) |
Contributor
There was a problem hiding this comment.
Can we do destructuring here kind of like
Suggested change
| const mostRecentRevisionId = parseInt(responseItems[0].meta['revision-id'], 10) | |
| const [{ meta: { 'revision-id': revisionId } }] = responseItems; | |
| const mostRecentRevisionId = parseInt(revisionId, 10); |
for consistency
htranho
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
What is the feature?
Reverting revision does not work for some collections
What is the Solution?
Looks like some revisions were private. Needed to pass an auth token to the headers in order to perform ingest mutations. Added that as well as some error handling.
What areas of the application does this impact?
datasource/collection.js
Testing
Reproduction steps
mutation RestoreCollectionRevision ( $revisionId: String!, $conceptId: String! ) { restoreCollectionRevision ( revisionId: $revisionId, conceptId: $conceptId ) { conceptId revisionId } }{ "conceptId": "C1200485688-MMT_1", "revisionId": "3" }That collection was previously not working. See how no data comes up with you call it directly from CMR with an auth token: https://cmr.sit.earthdata.nasa.gov/search/collections.umm_json?concept_id=C1200485688-MMT_1&all_revisions=true
You can now make revisions to both that and also public collections like this one: https://cmr.sit.earthdata.nasa.gov/search/collections.umm_json?concept_id=C1200450175-MMT_2&all_revisions=true
Attachments
Checklist