nens / threedi-api-qgis-client

3Di Models & Simulations plugin
https://plugins.lizard.net/
Other
2 stars 0 forks source link

Simulation wizard: stop trying when file processing status is "error" #504

Closed leendertvanwolfswinkel closed 9 months ago

leendertvanwolfswinkel commented 10 months ago

After you finish the simulation wizard, i.e. after you click "Start simulation" and all data is uploaded to initialize the simulation, it may in some cases wait a long time (until the user-defined timeout is reached) before concluding that it was not possible to start the simulation. This happens when there are errors in uploaded files, such as boundary conditions or structure control files.

The file has a state, and the object that owns the file has a state. For example, the object FileStructureControl owns a File which has possible states created, uploaded, processed, error, removed . The FileStructureControl itself has possible states processing, valid, invalid.

I suppose you monitor the state of the object that owns the File, e.g. the FileStructureControl ? In that case I think the behaviour should be:

    "filestructurecontrols": [
        {
            "url": "https://api.staging.3di.live/v3/simulations/28077/events/structure-control/file/964/",
            "id": 964,
            "uid": "32b422ad-981c-42ba-a30f-23114ff54c86",
            "simulation": "https://api.staging.3di.live/v3/simulations/28077/",
            "offset": 0,
            "file": {
                "url": "https://api.staging.3di.live/v3/files/101908/",
                "storage_name": "MINIO_DEV",
                "filename": "set_gate_level.json",
                "bucket": "3di",
                "prefix": null,
                "etag": "7780bd618948230a29fa463364d6e4e7",
                "size": 204,
                "expiry_date": "2023-10-24",
                "related_object": "https://api.staging.3di.live/v3/simulations/28077/events/structure-control/file/964/",
                "type": "bulkcontrol",
                "state": "error",
                "state_description": "{\"process_again\": false, \"error\": \"Invalid file, see related event for further details\"}",
                "meta": null,
                "id": 101908
            },
            "state": "invalid",
            "state_detail": {
                "timed control 0 invalid": {
                    "value": "set_gate_level requires 1 action value(s)."
                }
            }
        },
leendertvanwolfswinkel commented 9 months ago

LGTM, please merge @ldebek