emuR icon indicating copy to clipboard operation
emuR copied to clipboard

serve() gets stuck in endless "cannot open the connection" loop if SSFF track added but not present

Open kirbyj opened this issue 2 years ago • 0 comments

create_emuRdemoData(dir = tempdir())
path2ae = file.path(tempdir(), "emuR_demoData", "ae_emuDB")
ae = load_emuDB(path2ae, verbose = F)

Now edit ae_emuDBconfig.json so the default perspective looks like so:

   "EMUwebAppConfig": {
        "perspectives": [
            {   
                "name": "default",
                "signalCanvases": {
                    "order": [
                        "OSCI",
                        "SPEC",
                        "ksvF0"
                    ],
                    "assign": [

If you now try to serve(ae) you will get a very reasonable error message (in the webApp) that there was an

Error validating / checking DBconfig: "Error in EMUwebAppConfig/perspectives/signalCanvases/order! References to undefined ssffTracks are present. Following ssffTracks are not defined: ksvF0"

In the R console, you are returned to your command prompt.

However, if you then add_ssffTrackDefinition(ae, name="ksvF0", columnName="f0", fileExtension="f0") but do NOT actually create the SSFF track and try to serve(ae) again, you are treated to

emuR websocket service closed
emuR websocket service established
Error:  cannot open the connection 
emuR websocket service closed
emuR websocket service established
Error:  cannot open the connection 
emuR websocket service closed
emuR websocket service established
Error:  cannot open the connection 
emuR websocket service closed
emuR websocket service established
Error:  cannot open the connection 
emuR websocket service closed
emuR websocket service established

...for all eternity, until you force-quit the R session.

Obviously it does not make sense to add the SSFF track definition if you have no intention of adding the SSFF track itself, but the error handling seems like it could perhaps be improved.

kirbyj avatar Jun 07 '22 10:06 kirbyj