Skip to content

Conversation

@pdurbin
Copy link
Member

@pdurbin pdurbin commented Jul 21, 2025

What this PR does / why we need it:

  • displayAsRead boolean added to "get all"
  • new GET unreadCount API endpoint
  • new PUT markAsRead API endpoint

Which issue(s) this PR closes:

Special notes for your reviewer:

NotificationsIT points out two APIs that don't generate notifications at all:

  • UtilIT.createRandomDataverse
  • UtilIT.createRandomDatasetViaNativeApi

They probably should! And there are probably others. I opened this issue a while ago (10+ years!) about this:

As I mentioned in Slack, we could maybe go with just "read", "unread" (what GitHub uses), or "hasBeenRead" instead of "displayAsRead" (which comes from a transient variable used by JSF).

Existing methods in Notifications.java use a funny pattern to get an authenticated user. Methods I added use our standard getRequestAuthenticatedUserOrDie.

@ekraffmiller mentioned that #11648 is related and I plan to take a look, at least. I think a fix might be better as a follow up pull request. Update: a draft, for now:

Here are some related GitHub APIs I looked at:

They obviously store timestamps for when notifications were read but we only store booleans.

Suggestions on how to test this:

Try the endpoints mentioned in the docs for this PR.

Automated tests are also included. Make sure they are passing.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

No.

Is there a release notes update needed for this change?:

Yes, included.

Additional documentation:

Preview at https://dataverse-guide--11664.org.readthedocs.build/en/11664/api/native-api.html#notifications

- displayAsRead boolean added to "get all"
- new GET unreadCount API endpoint
- new PUT markAsRead API endpoint
@github-actions github-actions bot added FY26 Sprint 2 FY26 Sprint 2 (2025-07-16 - 2025-07-30) Original size: 10 Size: 10 A percentage of a sprint. 7 hours. SPA These changes are required for the Dataverse SPA SPA.Q3.2025.6 Account: Notifications Type: Feature a feature request labels Jul 21, 2025
@pdurbin pdurbin moved this to Ready for Review ⏩ in IQSS Dataverse Project Jul 21, 2025
@coveralls
Copy link

coveralls commented Jul 21, 2025

Coverage Status

coverage: 23.218% (+0.04%) from 23.175%
when pulling 5d753d1 on 11650-unread
into bfe59f0 on develop.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@sekmiller sekmiller self-assigned this Jul 22, 2025
@sekmiller sekmiller moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Jul 22, 2025
Copy link
Contributor

@sekmiller sekmiller left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for the quick fix on the doc

@github-project-automation github-project-automation bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Jul 22, 2025
@sekmiller sekmiller removed their assignment Jul 22, 2025
@github-actions
Copy link

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:11650-unread
ghcr.io/gdcc/configbaker:11650-unread

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@ofahimIQSS ofahimIQSS self-assigned this Jul 23, 2025
@ofahimIQSS ofahimIQSS moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Jul 23, 2025
@ofahimIQSS
Copy link
Contributor

ofahimIQSS commented Jul 24, 2025

curl -H "X-Dataverse-key:$API_TOKEN" "$SERVER_URL/api/notifications/all"
^ I ran this in internal with the dataverseadmin user and the api call failed. See server log.
image

11664 server.log

EDIT: was able to reproduce issue on the develop branch - created a separate issue to track this: #11683

@ofahimIQSS
Copy link
Contributor

ofahimIQSS commented Jul 24, 2025

Testing Passed - Merging. 11
11664testing.log

@ofahimIQSS ofahimIQSS merged commit d27d4c7 into develop Jul 24, 2025
16 checks passed
@github-project-automation github-project-automation bot moved this from QA ✅ to Merged 🚀 in IQSS Dataverse Project Jul 24, 2025
@ofahimIQSS ofahimIQSS deleted the 11650-unread branch July 24, 2025 14:39
@ofahimIQSS ofahimIQSS removed their assignment Jul 24, 2025
@scolapasta scolapasta moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Jul 24, 2025
@pdurbin pdurbin added this to the 6.8 milestone Jul 24, 2025
@cmbz cmbz added the FY26 Sprint 4 FY26 Sprint 4 (2025-08-13 - 2025-08-27) label Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 2 FY26 Sprint 2 (2025-07-16 - 2025-07-30) FY26 Sprint 4 FY26 Sprint 4 (2025-08-13 - 2025-08-27) Original size: 10 Size: 10 A percentage of a sprint. 7 hours. SPA.Q3.2025.6 Account: Notifications SPA These changes are required for the Dataverse SPA Type: Feature a feature request

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

Notifications API: support Read/Unread Status

6 participants