[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)
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python, react, typescript
- Bereich
- frontend, testing-qa, web-dev
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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).
- Vorherrschende Sprache
- Python
- Sterne
- 24.4k
- Forks
- 2.3k
- Ø Merge
- 2 T. 1 Std.
- Gemergte PRs (30 T.)
- 19
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus plotly/dash
-
good first issue P3 size: 1 task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
plotly/dash#3735 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
Shared-storage topics are never freed: streaming leaks ~32 frames per page loadEvtl. vergeben @T4rk1n hat das vor 2 Tagen übernommen. Offenbug P1 size: 3
plotly/dash#4010 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG] disable autocomplete in the date pickers inputEvtl. vergeben @AnnMarieW hat das vor 2 Tagen übernommen. Offenbug P2 size: 1
plotly/dash#4009 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG] Plotly Cloud devtool route crashes with FastAPI and Quart backendsEvtl. vergeben @T4rk1n hat das vor 2 Tagen übernommen. OffenP1 size: 1
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 65/100
plotly/dash#4008 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
correction metadata
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
acl-org/acl-anthology#10104 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug status/needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
prowler-cloud/prowler#12885 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug in GaussianTailProbabilityCalibrator: running_statistics=False still uses a windowed varianceOffenbug good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
selimfirat/pysad#107 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug ci-failure high priority
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
vllm-project/vllm-omni#8194 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag