cylc-ui icon indicating copy to clipboard operation
cylc-ui copied to clipboard

Empty cycle point - `getFamilyTree()` TypeError

Open MetRonnie opened this issue 1 year ago • 1 comments

Description

I had a workflow open with the tree view. I uninstalled, reinstalled, and started it.

Uncaught TypeError: Cannot read properties of undefined (reading 'slice')

Location: https://github.com/cylc/cylc-ui/blob/b0204f2d7d2d4848bd5f6d7ec9972f4ef23fc691/src/store/workflows.module.js#L322

node has no property ancestors.

It caused a cycle point to show up as empty, similar to in #1813

image

MetRonnie avatar Sep 04 '24 15:09 MetRonnie

Hmm, does this mean that GraphQL did not return the ancestors field on a task?

Try jamming in some console.logs to find out.

oliver-sanders avatar Sep 05 '24 13:09 oliver-sanders

It is possible to get this to happen 100% of the time by changing the default value of strip_null to True here: https://github.com/cylc/cylc-flow/blob/5625fa4165c507a63773f7d281c699376ac263b3/cylc/flow/network/schema.py#L2516-L2527

class Subscriptions(ObjectType):
    """Defines the subscriptions available in the schema."""
    class Meta:
        description = 'Multi-Workflow root level subscriptions.'

    deltas = Field(
        Deltas,
        description=Deltas._meta.description,
        workflows=graphene.List(
            ID, description="List of full ID, i.e. `~user/workflow_id`."
        ),
        strip_null=Boolean(default_value=True),

and then restarting the UI Server.

That way, for root family proxies, the ancestors field - which is normally an empty array - will be absent.

I note there is a comment below above another strip null argument with a default of False:

# TODO: Change these defaults post #3500 in coordination with WUI

We should probably defend against the ancestors field being absent here, easy enough fix.

MetRonnie avatar Dec 03 '25 16:12 MetRonnie