plotly / plotly/dash-auth

Issue when clientside callback is defined before public callback

Open
#161 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
135
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Example app below. If the clientside callback is defined before the public callback the app crashes. If the order is reversed the app works as expected.

from dash import Dash, Input, Output, clientside_callback, dcc, html

from dash_auth import public_callback

app = Dash()
app.layout = html.Div(
    [
        dcc.Location(id="url"),
        html.Div(id="clientside-callback-output"),
        html.Div(id="public-callback-output"),
    ]
)


clientside_callback(
    "function (pathname) {return `Hello ${pathname} from clientside callback!`;}",
    Output("clientside-callback-output", "children"),
    Input("url", "pathname"),
)


@public_callback(
    Output("public-callback-output", "children"),
    Input("url", "pathname"),
)
def public(pathname: str) -> str:
    return f"Hello {pathname} from public callback!"


if __name__ == "__main__":
    app.run(debug=True)

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 provided example app and reproduce the crash by defining clientside_callback before public_callback, then reverse their order for comparison. Trace the public_callback and clientside_callback registration entry points; done means both callbacks register and the app runs without crashing regardless of definition order.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.