fix: fix bug in notifications API related to SUBMITTEDDS notifications #12152
+36
−1
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.
What this PR does / why we need it:
While using the notifications API with
inAppNotificationFormat=true, I saw a lot of notifications about supposedly deleted datasets being submitted for review:However, I knew these datasets weren't actually deleted. After looking at the relevant Dataverse code, I believe I found a bug in
InAppNotificationsJsonPrinter.It tries to use the notification's
objectIdto look up the relevant dataset by ID, however, the notification'sobjectIdis not a dataset ID. It's a dataset version ID:dataverse/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/SubmitDatasetForReviewCommand.java
Line 66 in 8c23bf2
I've changed the code to correctly use the
objectIdto look up a dataset version by ID.Special notes for your reviewer:
/
Suggestions on how to test this:
I believe this bug might not always show up, for example in simple test cases which only create a single dataset with a single version, because in that case, it's possible that the dataset version ID and dataset ID are in sync. I've therefore slightly extended the
InReviewWorkflowITtest case to create a second dataset version to try and force the bug to show up.In my tests, it's worked. Without the fix, the test failed:
With the fix, the test succeeded.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
/
Is there a release notes update needed for this change?:
I'm not sure this is a highly relevant bug, so maybe not.
Additional documentation:
/