[4.5.0rc0] Clientside callback runs with a stale Input value after set_props on page load (regression from 4.4.1, clientside callbacks now exempt from the HTTP-slot budget)
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- python, react, typescript
- Ambito
- frontend, testing-qa, web-dev
Direzione di ricerca
Start in observers/prioritizedCallbacks.ts and observers/requestSlot.ts, then compare the built dash_renderer.min.js behavior with and without clientside callbacks counting toward the HTTP-slot budget. Reproduce the full-app sequence using the readUrl and tabSearch callbacks, and trace the callback scheduling and Input values. Done means the page settles after load and preserves ?tab=history without the infinite loop.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
On a page with many server callbacks firing at load, a URL-to-component sync set up with two clientside callbacks goes into an infinite loop on 4.5.0rc0. It works on 4.4.1.
readUrl: Inputurl.search,prevent_initial_call="initial_duplicate". It callsdash_clientside.set_props("tabs", {"value": <tab from ?tab=>}).tabSearch: Inputtabs.value, Stateurl.search, Outputurl.search(allow_duplicate=True),prevent_initial_call=True. It writes?tab=<value>back to the URL.
Loading /page?plan=21&tab=history on 4.5.0rc0 gives this trace (store = the tabs.value in window.store):
1397ms store tabs.value undefined -> "scope" (layout default)
1748ms readUrl: set_props("tabs", {value: "history"}) ; store -> "history"
1759ms tabSearch runs, triggered [{"prop_id":"tabs.value","value":"scope"}] <-- stale value
1934ms tabSearch runs, triggered [{"prop_id":"tabs.value","value":"history"}]
... the stale run writes ?plan=21, readUrl sets the tab back to "scope", tabSearch gets "history"... forever
tabSearch runs twice, and the first run gets the layout's stale value even though the store already holds the value set_props wrote. On 4.4.1 it runs once, with "history".
Bisected to the renderer change in observers/prioritizedCallbacks.ts / observers/requestSlot.ts (from #3931, commit ce7530ca25), which exempts clientside callbacks from the 12-slot HTTP budget. With only !cb.callback.clientside_function && removed from usesRequestSlot in the built dash_renderer.min.js, so clientside callbacks count toward the budget again as in 4.4.1, the same page settles: one request after load, ?tab=history kept, History tab selected. With the stock 4.5.0rc0 renderer the page loops until the browser tab crashes.
The CHANGELOG entry for #3931 doesn't mention the scheduling change.
Repro status
Our reduced app (dmc.Tabs + the two callbacks above, a router callback returning the page, 20 slow server callbacks on load) did NOT reproduce the 4.4.1/4.5 difference, so the exact extra condition is still unknown. The evidence above comes from the full app, where swapping only that renderer line toggles the bug. Happy to test a candidate fix.
Environment: dash 4.5.0rc0 (FastAPI backend), dash-mantine-components 2.8.0, React 18.3.1 (default), Chrome stable (Playwright), Python 3.14.
Workaround: guard the URL writer against its own echo (ignore tabs.value events until the value set_props wrote comes back).
- Lingua principale
- Python
- Stelle
- 24.4k
- Fork
- 2.3k
- Merge medio
- 2g 23m
- PR unite (30g)
- 17
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di plotly/dash
-
good first issue P3 size: 1 task
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
plotly/dash#3735 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 2 giorni
-
Shared-storage topics are never freed: streaming leaks ~32 frames per page loadForse già presa @T4rk1n l’ha presa 3 giorni fa. Apertabug P1 size: 3
plotly/dash#4010 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
[BUG] disable autocomplete in the date pickers inputForse già presa @AnnMarieW l’ha presa 3 giorni fa. Apertabug P2 size: 1
plotly/dash#4009 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
[BUG] Plotly Cloud devtool route crashes with FastAPI and Quart backendsForse già presa @T4rk1n l’ha presa 3 giorni fa. ApertaP1 size: 1
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
plotly/dash#4008 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
qgis/QGIS-Plugins-Website#459 ·
-
bug severity:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
bot-found bug priority: P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
madenvel/KalinkaPlayer#179 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ls1intum/edutelligence#1098 ·
I maintainer di solito rispondono entro 1 giorno