You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When set_props is used within a callback that later hits raise PreventUpdate, the properties set by set_props do not propagate back to the server when the callback ends. This is in direct contrast to no_update. Based on my understanding of the docs here, both raise PreventUpdate and return no_update (if applied to all outputs) should both have the same behavior in regards to updating outputs.
@callback(...)defcallback_prevent_update(...):
"""Does NOT set prop_id_here->is_open to True"""set_props("prop_id_here", {"is_open": True})
raisePreventUpdate@callback(...)defcallback_no_update(...):
"""Does set prop_id_here->is_open to True"""set_props("prop_id_here", {"is_open": True})
returnno_update
Expected behavior
I expected that raise PreventUpdate would have the exact same behavior as return no_update (when applied to all outputs) which is that the outputs of a callback do not update, but the set_props call still goes through.
If it's expected that these produce two different behaviors, then it might be worth updating the caveats here with this case as it's unexpected behavior compared to the standard Input/Output behavior in callbacks. I'm happy to help update the documentation if there's a code pointer on where to add it! ( I didn't see the docs folder on a quick initial look)
Screenshots
In the chrome networking tab, the original callback in the example returns the following:
When raise PreventUpdate is added, the example returns the following (Note the status code in the second image is now 204 instead of 200):
Minimal Reproducible Example
This is taken directly from here, with the only change being the raise PreventUpdate line
Steps to reproduce
Load the page
Click on one of the rows
A modal should have popped up, but does not due to the raise PreventUpdate
The text was updated successfully, but these errors were encountered:
gvwilson
changed the title
[BUG] "raise PreventUpdate" prevents any side channel property updates through "set_props"
"raise PreventUpdate" prevents any side channel property updates through "set_props"
Aug 26, 2024
Thanks for maintaining this library, I really appreciate it!
Describe your context
Describe the bug
When
set_props
is used within a callback that later hitsraise PreventUpdate
, the properties set byset_props
do not propagate back to the server when the callback ends. This is in direct contrast tono_update
. Based on my understanding of the docs here, bothraise PreventUpdate
andreturn no_update
(if applied to all outputs) should both have the same behavior in regards to updating outputs.Expected behavior
I expected that
raise PreventUpdate
would have the exact same behavior asreturn no_update
(when applied to all outputs) which is that theoutputs
of a callback do not update, but theset_props
call still goes through.If it's expected that these produce two different behaviors, then it might be worth updating the caveats here with this case as it's unexpected behavior compared to the standard Input/Output behavior in callbacks. I'm happy to help update the documentation if there's a code pointer on where to add it! ( I didn't see the docs folder on a quick initial look)
Screenshots
![image](https://private-user-images.githubusercontent.com/5797304/360709287-b9c6a227-ffaa-4581-b3b2-9a04aadfb756.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3NjI2NzMsIm5iZiI6MTcyNTc2MjM3MywicGF0aCI6Ii81Nzk3MzA0LzM2MDcwOTI4Ny1iOWM2YTIyNy1mZmFhLTQ1ODEtYjNiMi05YTA0YWFkZmI3NTYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDhUMDIyNjEzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTgyMDViZjE1N2ZhNzA1MWU2MmE2NTZjNGFmOTFhNDY4YTFiYjJjODJiYTY3OTUxZjViNzUyNTAyN2QxN2E4MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.w5USIW4-uL65GsDKG96aIIOXcDeH9s89dw5lLO-nWJM)
In the chrome networking tab, the original callback in the example returns the following:
When
![image](https://private-user-images.githubusercontent.com/5797304/360709386-596b3039-ecbc-4c72-8ff0-91da22292708.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIs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MzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDhUMDIyNjEzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjhlMzc0N2YwNDM2MzQzZWY2NTI5OGZhN2IzNzI1ODhkZDZlYWQyZDczMzE0Yjg5ZDY2YTBkODZjYjA1N2NjMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.idxq8XdmGnmainj6156XerQGMKtCgkaQA2tpkrlsrSc)
raise PreventUpdate
is added, the example returns the following (Note the status code in the second image is now 204 instead of 200):Minimal Reproducible Example
This is taken directly from here, with the only change being the
raise PreventUpdate
lineSteps to reproduce
raise PreventUpdate
The text was updated successfully, but these errors were encountered: