Skip to content

fix: fix bug in notifications API related to SUBMITTEDDS notifications#12152

Merged
stevenwinship merged 6 commits intoIQSS:developfrom
vera:fix/submittedds-notification-in-app-format
Feb 27, 2026
Merged

fix: fix bug in notifications API related to SUBMITTEDDS notifications#12152
stevenwinship merged 6 commits intoIQSS:developfrom
vera:fix/submittedds-notification-in-app-format

Conversation

@vera
Copy link
Contributor

@vera vera commented Feb 6, 2026

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:

image

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 objectId to look up the relevant dataset by ID, however, the notification's objectId is not a dataset ID. It's a dataset version ID:

ctxt.notifications().sendNotification(au, new Timestamp(new Date().getTime()), UserNotification.Type.SUBMITTEDDS, savedDataset.getLatestVersion().getId(), "", requestor, false);

I've changed the code to correctly use the objectId to 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 InReviewWorkflowIT test 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:

[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   InReviewWorkflowIT.testCuratorSendsCommentsToAuthor:459 1 expectation failed.
JSON path data[0].datasetPersistentIdentifier doesn't match.    

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:

/

@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project Feb 10, 2026
@scolapasta scolapasta moved this from Ready for Triage to Ready for Review ⏩ in IQSS Dataverse Project Feb 10, 2026
@cmbz cmbz added FY26 Sprint 16 FY26 Sprint 16 (2026-01-28 - 2026-02-11) FY26 Sprint 17 FY26 Sprint 17 (2026-02-11 - 2026-02-25) labels Feb 11, 2026
@scolapasta scolapasta moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Feb 17, 2026
@scolapasta scolapasta self-assigned this Feb 17, 2026
@github-project-automation github-project-automation bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Feb 24, 2026
@cmbz cmbz added the FY26 Sprint 18 FY26 Sprint 18 (2026-02-25 - 2026-03-11) label Feb 26, 2026
@stevenwinship stevenwinship moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Feb 26, 2026
@stevenwinship
Copy link
Contributor

@vera
Could you take a look at the failing test (InAppNotificationsJsonPrinterTest.testAddFieldsByType_submittedDs)?
I merged develop into this branch because of a small conflict (nothing to do with this failure)
The failing test works if I undo your change to the "addDatasetVersionFields(notificationJson, userNotification);" line.

@vera
Copy link
Contributor Author

vera commented Feb 27, 2026

@vera Could you take a look at the failing test (InAppNotificationsJsonPrinterTest.testAddFieldsByType_submittedDs)? I merged develop into this branch because of a small conflict (nothing to do with this failure) The failing test works if I undo your change to the "addDatasetVersionFields(notificationJson, userNotification);" line.

Should be fixed now!

@stevenwinship stevenwinship merged commit 5230722 into IQSS:develop Feb 27, 2026
14 checks passed
@github-project-automation github-project-automation bot moved this from QA ✅ to Merged 🚀 in IQSS Dataverse Project Feb 27, 2026
@stevenwinship stevenwinship removed their assignment Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 16 FY26 Sprint 16 (2026-01-28 - 2026-02-11) FY26 Sprint 17 FY26 Sprint 17 (2026-02-11 - 2026-02-25) FY26 Sprint 18 FY26 Sprint 18 (2026-02-25 - 2026-03-11)

Projects

Status: Merged 🚀

Development

Successfully merging this pull request may close these issues.

4 participants