Fix MyData 500 Error when results include files - #12663
Open
ChengShi-1 wants to merge 2 commits into
Open
Conversation
RoleTagRetriever.findDataverseIdsForFiles cast dvobject.id to Integer. That column is an integer in databases created by older releases but a bigint in newly created ones, so the JDBC driver returns a Long and the cast threw a ClassCastException, failing every My Data request whose results included a file. Read the value as a Number instead, which is correct for both column types and needs no migration. DvObjectServiceBean.getObjectPathsByIds had the same cast, where it silently skipped rows rather than throwing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
This comment has been minimized.
This comment has been minimized.
|
📦 Pushed preview images as 🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
ChengShi-1
marked this pull request as ready for review
September 1, 2026 23:08
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.



What this PR does / why we need it:
Related to #12498 merged
dvId = ((Number)ra[0]).longValue();hereOn installations whose database was created recently,
dvobject.idis abigintcolumn, so the JDBC driver returns aLongfor it. My Data read that value as anInteger, which made/api/mydata/retrieve(and the My Data page) fail with aClassCastExceptionand an HTTP 500 for any request whose results included a file. The value is now read as aNumber, which is correct whether the column is aninteger(older databases) or abigint(newer ones).Which issue(s) this PR closes:
Special notes for your reviewer:
Suggestions on how to test this:
Requires a freshly created database
GET /api/v1/mydata/retrieve ?role_ids=1&role_ids=2&role_ids=3&role_ids=4&role_ids=5&role_ids=6&role_ids=7&role_ids=8 &dvobject_types=Dataverse&dvobject_types=Dataset&dvobject_types=DataFile &published_states=Draft&published_states=UnpublishedBefore this change that returns a 500; after it, the collection, dataset and file are returned. Requests that exclude
DataFilesucceed either way, which is a useful control: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?:
Additional documentation: