Store with -0.0 and storage_type equal to session
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.4k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 13
Description
dash 2.13.0
dash-bootstrap-components 1.4.2
dash-core-components 2.0.0
dash-html-components 2.0.0
dash-table 5.0.0
- Browser firefox
from dash import Dash, dcc, Output, Input, State, html
app = Dash(name)
app.layout = html.Div(
[
dcc.Input(id="input"),
dcc.Store('store', storage_type="session", ), # get error
#dcc.Store('store', storage_type="memory", ), # is ok
]
)
@app.callback(
Output("store", 'data'),
Input('input', "value"),
State("store", 'data'),
prevent_initial_call=False,
)
def main_callback(input, store):
lst = [0.0*-1 , 6.0]
return lst
app.run(debug=True)
with the above code I get:
Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
If I use memory, the error does not occure. If I use session and a value different from -0.0 it works as well.
Any clue on that?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by running the provided Dash reproduction in Firefox, then compare session and memory storage with and without -0.0. Done means identifying the cause of the repeated update and confirming the reproduction no longer reaches the maximum update depth, with regression coverage if the project has a suitable test location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, react
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100