Skip to content

Wildcard callbacks during app initialization behave improperly #1247

Open

Description

Using dash==1.12.0

Looking at the dash-renderer test cbmo003(https://github.com/plotly/dash/blob/dev/tests/integration/callbacks/test_missing_outputs.py#L187), the initialization behavior seems to be incorrect.

The callbacks are:
cb1. items.n_clicks -> (content1.children, content2.children) , children of content1 are of shape {i: number} , children of content2 are of shape {j: number}
cb2. values.n_clicks -> ({i:ALL}.children, {j:ALL}.children)
cb3. ({i:ALL}.children, {j:ALL}.children) -> output.children

At initialization, cb1 and cb3 are triggered

  • cb1 returns 2 children from content1 and none for content2, the children of these wildcard components are all null
  • cb1 result processing triggers cb2 because there’s now != 0 wildcard outputs
  • cb3 is run with children values ([None, None], []) and returns 0because of value or 0
  • cb2 is run with None -> ([0, 0], [])

Expected behavior
We trigger cb3 again after assigning the children values after cb2 , similar to the followForward cases. The problem becomes more apparent when changing cb2 to return, for example, 5 instead of 0 on the None case — the test now displays the screenshot below, showing that it never really used the children content to calculate itself during initialization.

image

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

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions