diff --git a/lib/galaxy/datatypes/converters/interval_to_bgzip_converter.xml b/lib/galaxy/datatypes/converters/interval_to_bgzip_converter.xml index 52e1e8d7b98f..fe1df3514d19 100644 --- a/lib/galaxy/datatypes/converters/interval_to_bgzip_converter.xml +++ b/lib/galaxy/datatypes/converters/interval_to_bgzip_converter.xml @@ -41,7 +41,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -61,7 +61,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -80,10 +80,9 @@ - - + + + @@ -92,9 +91,9 @@ - + - + diff --git a/lib/galaxy/datatypes/converters/vcf_to_vcf_bgzip_converter.xml b/lib/galaxy/datatypes/converters/vcf_to_vcf_bgzip_converter.xml index 41617707e2b9..f6ebadcf1d34 100644 --- a/lib/galaxy/datatypes/converters/vcf_to_vcf_bgzip_converter.xml +++ b/lib/galaxy/datatypes/converters/vcf_to_vcf_bgzip_converter.xml @@ -17,7 +17,7 @@ - + diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 136aff1b646e..9d38bda53b32 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -11004,7 +11004,9 @@ def __repr__(self): # See https://github.com/sqlalchemy/sqlalchemy/discussions/7638 for approach session_partition = select( GalaxySession, - func.row_number().over(order_by=GalaxySession.update_time, partition_by=GalaxySession.user_id).label("index"), + func.row_number() + .over(order_by=GalaxySession.update_time.desc(), partition_by=GalaxySession.user_id) + .label("index"), ).alias() partitioned_session = aliased(GalaxySession, session_partition) User.current_galaxy_session = relationship( diff --git a/test/unit/data/test_galaxy_mapping.py b/test/unit/data/test_galaxy_mapping.py index c7a2d4eb8366..8e1ba80f6d06 100644 --- a/test/unit/data/test_galaxy_mapping.py +++ b/test/unit/data/test_galaxy_mapping.py @@ -692,6 +692,17 @@ def _non_empty_flush(self): session.add(lf) session.flush() + def test_current_session(self): + user = model.User(email="testworkflows@bx.psu.edu", password="password") + galaxy_session = model.GalaxySession() + galaxy_session.user = user + self.persist(user, galaxy_session) + assert user.current_galaxy_session == galaxy_session + new_galaxy_session = model.GalaxySession() + new_galaxy_session.user = user + self.persist(user, new_galaxy_session) + assert user.current_galaxy_session == new_galaxy_session + def test_flush_refreshes(self): # Normally I don't believe in unit testing library code, but the behaviors around attribute # states and flushing in SQL Alchemy is very subtle and it is good to have a executable