8000 Fix logic when looking up pn.state.curdoc by philippjfr · Pull Request #6254 · holoviz/panel · GitHub
[go: up one dir, main page]

Skip to content

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

@codecov
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
@philippjfr philippjfr deleted the try_finally_state branch January 22, 2024 15:59
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.3.7rc3 does not pick up cookies

2 participants

0