Commit c9303ca
This PR cherry-picks changes from the original PR #24400 to branch 25.1.
---
#### Original PR description
> ## Summary
>
> - Clear the session-scoped transaction **before** running pending
access tasks during session unlock
> - This ensures effects triggered by access tasks see fresh signal
values instead of stale cached values from the repeatable read
transaction
> - Added a unit test to verify that clearing the transaction fallback
allows fresh reads
>
> ## Details
>
> When a shared signal is updated concurrently with an ongoing UIDL
request, effects associated with that UI would run with the repeatable
read transaction used for the request. If the transaction cached the old
value, effects would miss the update.
>
> The fix moves `sessionScopedTransaction = null` to execute before
`runPendingAccessTasks()` instead of after, ensuring access tasks read
fresh values.
>
> ## Test plan
>
> - [ ] Existing unit tests pass
> - [ ] New `clearingFallback_allowsFreshReads` test verifies the fix
behavior
> - [ ] Manual test with the reproduction case from the issue
>
> Fixes #24399
>
> Slack thread:
https://vaadin.slack.com/archives/C6RAXJATF/p1779368249043829?thread_ts=1779368185.339629&cid=C6RAXJATF
>
> https://claude.ai/code/session_01QW3F8K4uxGyaUNa9xwoKTR
>
> ---
> _Generated by [Claude
Code](https://claude.ai/code/session_01QW3F8K4uxGyaUNa9xwoKTR)_
Co-authored-by: Artur Signell <artur@vaadin.com>
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 76d6a85 commit c9303ca
3 files changed
Lines changed: 63 additions & 0 deletions
File tree
- flow-server/src
- main/java/com/vaadin/flow/server
- test/java/com/vaadin/flow/dom
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2337 | 2337 | | |
2338 | 2338 | | |
2339 | 2339 | | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
2340 | 2343 | | |
2341 | 2344 | | |
2342 | 2345 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
724 | 735 | | |
725 | 736 | | |
726 | 737 | | |
| |||
Lines changed: 49 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
456 | 457 | | |
457 | 458 | | |
458 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
459 | 508 | | |
460 | 509 | | |
461 | 510 | | |
| |||
0 commit comments