Skip to content

[BUG] Handle missing timing_information gracefully #1624

@remibaar

Description

@remibaar

Describe your context

dash                      1.17.0                  
dash-core-components      1.13.0             
dash-html-components      1.1.1              
dash-renderer             1.8.3              

Describe the bug
An error is raised when the devtools before request is not fully executed.
AttributeError: '_AppCtxGlobals' object has no attribute 'timing_information'
In our case this happens because we register our own "before request" to the flask instance, to handle user logins. Flask will not execute any other before_request_funcs when a function returns something other than None. If an user is not logged in, we will throw a redirect to the login page.

So during the "before_request" phase the timing_information is not set. During the "after_request" phase, it expects timing_information was set. If not it will throw an error.

The error is caused by these lines: https://github.com/plotly/dash/blob/master/dash/dash.py#L1465-L1489

Expected behavior
It should check if the timing_information is set, and not expect it is. If it is not it gracefully should handle the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions