Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logic when looking up pn.state.curdoc #6254

Merged
merged 2 commits into from Jan 22, 2024
Merged

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Jan 22, 2024

In #5952 we refactored the try/finally block of pn.state.curdoc. However in doing so we didn't take into account that the finally block is always processed last and any value returned in the finally block takes precedence. We now refactor this block correctly to ensure that we always look up the curdoc in the ContextVar first ensuring that async callbacks return the correct curdoc.

Fixes #6252

Copy link

codecov bot commented Jan 22, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (2a892a3) 84.20% compared to head (4700b9d) 84.19%.
Report is 2 commits behind head on main.

Files Patch % Lines
panel/tests/ui/io/test_state.py 64.00% 9 Missing ⚠️
panel/io/state.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6254      +/-   ##
==========================================
- Coverage   84.20%   84.19%   -0.01%     
==========================================
  Files         301      301              
  Lines       45157    45190      +33     
==========================================
+ Hits        38023    38047      +24     
- Misses       7134     7143       +9     
Flag Coverage Δ
ui-tests 40.74% <69.56%> (+0.02%) ⬆️
unitexamples-tests 71.83% <45.65%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@philippjfr philippjfr merged commit 6c74148 into main Jan 22, 2024
15 checks passed
@philippjfr philippjfr deleted the try_finally_state branch January 22, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.3.7rc3 does not pick up cookies
1 participant