Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drilling down sub-collections in the UI can be stuck in a loop in some circumstances #16785

Closed
davelopez opened this issue Oct 4, 2023 · 0 comments · Fixed by #16819
Closed

Comments

@davelopez
Copy link
Contributor

davelopez commented Oct 4, 2023

Related Selenium test currently failing:

FAILED lib/galaxy_test/selenium/test_history_multi_view.py::TestHistoryMultiView::test_list_list_display - selenium.common.exceptions.TimeoutException: Message: Failed waiting on history item 3 to become visible, visible datasets include [#dataset-f06d708dacad69d8,#dataset-da92407cb46a61f3]. Timeout waiting on CSS selector [.multi-history-panel .content-item[data-hid="3"]] to become visible.

Most of the details are already in #16754 (comment) moving it to its own issue as they are unrelated.

Summary

Now everything is starting to make sense, but still, I have a piece of the puzzle missing in my head...

The "collection loop issue" is caused by this change I made in #16725

const collection = await collectionElementsStore.getCollection(itemObject.id);

I was wrongly assuming the ID of the DCObject (DatasetCollection) was the same ID used to query api/dataset_collections/{id} so I fetched the "collection" from the store to drill down.

These are the values of the variables in the case of the test failure:

itemObject: DCObject
{
    "id": "df7a1f0c02a5b08e", <-- This is a DatasetCollection ID
    "model_class": "DatasetCollection",
    "collection_type": "list",
    "populated": null,
    "element_count": null,
    "contents_url": "/api/dataset_collections/df7a1f0c02a5b08e/contents/df7a1f0c02a5b08e", <- ID coincidence...
    "elements": []
}
collection: HDCA
{
    "id": "df7a1f0c02a5b08e", <- HDCA ID
    "name": "list:list",
    "history_id": "ee3742ed6d8b4a0c",
    "hid": 5,
    "deleted": false,
    "visible": true,
    "type_id": null,
    "type": "collection",
    "create_time": "2023-10-02T13:25:26.649540",
    "update_time": "2023-10-02T13:25:26.649545",
    "url": "/api/histories/ee3742ed6d8b4a0c/contents/dataset_collections/df7a1f0c02a5b08e",
    "tags": [],
    "history_content_type": "dataset_collection",
    "model_class": "HistoryDatasetCollectionAssociation",
    "collection_type": "list:list",
    "populated_state": "ok",
    "populated_state_message": null,
    "element_count": 1,
    "job_source_id": null,
    "job_source_type": null,
    "job_state_summary": {
        "all_jobs": 0,
        "new": 0,
        "waiting": 0,
        "running": 0,
        "error": 0,
        "paused": 0,
        "skipped": 0,
        "deleted_new": 0,
        "resubmitted": 0,
        "queued": 0,
        "ok": 0,
        "failed": 0,
        "deleted": 0,
        "upload": 0
    },
    "contents_url": "/api/dataset_collections/df7a1f0c02a5b08e/contents/0a248a1f62a0cc04",
    "collection_id": "0a248a1f62a0cc04",
    "populated": true,
    "elements": [
        {
            "id": "1e8ab44153008be8",
            "model_class": "DatasetCollectionElement",
            "element_index": 0,
            "element_identifier": "test0",
            "element_type": "dataset_collection",
            "object": {
                "id": "df7a1f0c02a5b08e", <- Coincidence...
                "model_class": "DatasetCollection",
                "collection_type": "list",
                "populated": true,
                "element_count": 3,
                "contents_url": null,
                "elements": [
                    {
                        "id": "c9468fdb6dc5c5f1",
                        "model_class": "DatasetCollectionElement",
                        "element_index": 0,
                        "element_identifier": "data0",
                        "element_type": "hda",
                        "object": {
                            "id": "2d9035b3fc152403",
                            "model_class": "HistoryDatasetAssociation",
                            "state": "ok",
                            "hda_ldda": "hda",
                            "history_id": "ee3742ed6d8b4a0c",
                            "tags": [],
                            "create_time": "2023-10-02T13:25:26.537999",
                            "validated_state": "unknown",
                            "peek": "<table cellspacing=\"0\" cellpadding=\"3\"><tr><td>TestData123</td></tr></table>",
                            "metadata_dbkey": "?",
                            "deleted": false,
                            "name": "data0",
                            "file_size": 12,
                            "visible": false,
                            "purged": false,
                            "uuid": "80a8fa98-5f94-43d1-b77e-deaddc8042c5",
                            "misc_blurb": "1 line",
                            "misc_info": null,
                            "hid": 2,
                            "metadata_data_lines": 1,
                            "file_ext": "txt",
                            "update_time": "2023-10-02T13:25:26.538003",
                            "history_content_type": "dataset",
                            "data_type": "galaxy.datatypes.data.Text",
                            "validated_state_message": null,
                            "genome_build": "?"
                        }
                    },
                    {
                        "id": "2a56795cad3c7db3",
                        "model_class": "DatasetCollectionElement",
                        "element_index": 1,
                        "element_identifier": "data1",
                        "element_type": "hda",
                        "object": {
                            "id": "5a1cff6882ddb5b2",
                            "model_class": "HistoryDatasetAssociation",
                            "state": "ok",
                            "hda_ldda": "hda",
                            "history_id": "ee3742ed6d8b4a0c",
                            "tags": [],
                            "create_time": "2023-10-02T13:25:26.538006",
                            "validated_state": "unknown",
                            "peek": "<table cellspacing=\"0\" cellpadding=\"3\"><tr><td>TestData123</td></tr></table>",
                            "metadata_dbkey": "?",
                            "deleted": false,
                            "name": "data1",
                            "file_size": 12,
                            "visible": false,
                            "purged": false,
                            "uuid": "bc2e2adb-5153-4140-9011-cc94ee7a9763",
                            "misc_blurb": "1 line",
                            "misc_info": null,
                            "hid": 3,
                            "metadata_data_lines": 1,
                            "file_ext": "txt",
                            "update_time": "2023-10-02T13:25:26.538008",
                            "history_content_type": "dataset",
                            "data_type": "galaxy.datatypes.data.Text",
                            "validated_state_message": null,
                            "genome_build": "?"
                        }
                    },
                    {
                        "id": "4b187121143038ff",
                        "model_class": "DatasetCollectionElement",
                        "element_index": 2,
                        "element_identifier": "data2",
                        "element_type": "hda",
                        "object": {
                            "id": "d413a19dec13d11e",
                            "model_class": "HistoryDatasetAssociation",
                            "state": "ok",
                            "hda_ldda": "hda",
                            "history_id": "ee3742ed6d8b4a0c",
                            "tags": [],
                            "create_time": "2023-10-02T13:25:26.538011",
                            "validated_state": "unknown",
                            "peek": "<table cellspacing=\"0\" cellpadding=\"3\"><tr><td>TestData123</td></tr></table>",
                            "metadata_dbkey": "?",
                            "deleted": false,
                            "name": "data2",
                            "file_size": 12,
                            "visible": false,
                            "purged": false,
                            "uuid": "93f3361e-c18c-42d9-8575-f4e03176d688",
                            "misc_blurb": "1 line",
                            "misc_info": null,
                            "hid": 4,
                            "metadata_data_lines": 1,
                            "file_ext": "txt",
                            "update_time": "2023-10-02T13:25:26.538013",
                            "history_content_type": "dataset",
                            "data_type": "galaxy.datatypes.data.Text",
                            "validated_state_message": null,
                            "genome_build": "?"
                        }
                    }
                ]
            }
        }
    ],
    "elements_datatypes": [
        "txt"
    ]
}

The mixed ID df7a1f0c02a5b08e was causing the drill-down collection stack to push always the same HDCA, creating the loop. That could explain why it failed only when more selenium tests were run vs. just running TestHistoryMultiView::test_list_list_display in isolation. There was a higher chance of hitting this mixed ID issue.

The missing part of the puzzle is the actual solution 😅 I need to wrap my head around the different concepts related to collections, HDCA, DCE, DC... but maybe someone more versed in collection internals can help... The previous solution relied on querying the contents_url for drilling down, but I wanted to use the fetcher to get all the typing benefits and make use of the store for caching results.

Any ideas on how to do the correct query here?

Galaxy Version and/or server at which you observed the bug
Galaxy Version: dev
Commit: (run git rev-parse HEAD if you run this Galaxy server)

To Reproduce
Steps to reproduce the behavior:

  1. Create a collection with sub-collections
  2. Try to drill down into the sub-collections by clicking on the UI entry.
  3. Observe that in some situations, the UI doesn't seem to update with the contents of the sub-collection.

Expected behavior
You can view the contents of the sub-collection.

Additional context
In the UI it looks like the drilling down doesn't do anything, but it is actually displaying the same parent collection every time you click on the sub-collection pushing it to the navigation (breadcrumbs) stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

1 participant