plotly / plotly/dash

Wildcard callbacks during app initialization behave improperly

Open
#1,247 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the dash-renderer integration test cbmo003 in tests/integration/callbacks/test_missing_outputs.py, especially the linked section around line 187. Trace initialization through cb1, cb2, and cb3 and compare it with the followForward cases. Done means cb3 runs again after wildcard children receive their cb2 values, using those values during initialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.