[26.0] Reject malformed dataset ids in data tool parameter#22617
Merged
Conversation
Strings like "hda:<encoded_id>" reached SQLAlchemy as the HDA primary key and crashed Postgres with InvalidTextRepresentation (xref galaxyproject#22616). The "src:id" shape is not part of the API surface — those inputs should arrive as {src, id} dicts via src_id_to_item — so reject anything that isn't an int, digit string, or 16-char encoded id with ParameterValueError, which the parameter pipeline maps to a 4xx.
jmchilton
reviewed
May 1, 2026
| s = str(value) | ||
| if s.isdigit(): | ||
| return int(s) | ||
| if len(s) == 16: |
Member
There was a problem hiding this comment.
These aren't of fixed size right? Are they multiples or 8 or 16 or something like that?
Member
Author
There was a problem hiding this comment.
That is a port of the code from line 2200. We could also reject strings entirely, that would probably be the correct move ?
jmchilton
approved these changes
May 22, 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.
Strings like "hda:<encoded_id>" reached SQLAlchemy as the HDA primary key and crashed Postgres with InvalidTextRepresentation (xref #22616). The "src:id" shape is not part of the API surface — those inputs should arrive as {src, id} dicts via src_id_to_item — so reject anything that isn't an int, digit string, or 16-char encoded id with ParameterValueError, which the parameter pipeline maps to a 4xx.
How to test the changes?
(Select all options that apply)
License