Repository navigation
Commit 5383cd9
committed
fix(extension): dispatch webview postMessage without awaiting the renderer ack
postMessageToWebview awaited the webview postMessage promise, which VS
Code only settles once the webview page acknowledges the message. When
the page is remounted or reloaded, or the view is disposed while the
post is in flight, that promise is orphaned forever and every caller
awaiting it wedges on the task critical path.
This wedged the tab task in the e2e view-state test: switch_mode
awaited handleModeSwitch, whose trailing postStateToWebview was blocked
on the orphaned ack during a webview remount, so the task's next turn
never started and the 30s waitUntilCompleted timed out.
Dispatch the post without awaiting the ack (with a rejection catch).
Message ordering is enforced by the message seq, not by the ack.
Add a unit regression test asserting postMessageToWebview returns
without waiting for the renderer ack.1 parent 02b5ea8 commit 5383cd9
2 files changed
Lines changed: 33 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1733 | 1733 | | |
1734 | 1734 | | |
1735 | 1735 | | |
1736 | | - | |
1737 | | - | |
1738 | | - | |
1739 | | - | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
1740 | 1739 | | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
1741 | 1750 | | |
1742 | 1751 | | |
1743 | 1752 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
771 | 771 | | |
772 | 772 | | |
773 | 773 | | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
774 | 794 | | |
775 | 795 | | |
776 | 796 | | |
| |||
0 commit comments