Repository navigation
Commit da8d752
committed
fix(webview): harden recovery reload and scope sidebar disposal cleanup
What: The recovery reload captures lastWebviewHeartbeatAt when recovery
starts and, after the awaited HTML generation, additionally requires the
heartbeat timestamp to be unchanged and the captured view to still be
visible before reassigning webview.html. The sidebar onDidDispose handler
now runs clearWebviewResources() and the codeIndexManager reset only when
the disposed view is the currently watched one. Cancellation specs defer
getWebviewHtml() itself (instead of getState() with a fabricated state)
so they prove disposal and replacement land while recovery is in flight,
and new specs cover heartbeat-during-recovery and hide-during-recovery
skips.
Why: A heartbeat arriving during recovery means the renderer is alive
again, and a view that hides mid-recovery no longer proves a dead
renderer (hidden webviews throttle timers), so reloading in either case
needlessly reloads a healthy or throttled webview. This mitigates the
security audit finding LOW-1 (self-reload loop when the postMessage
bridge is half-broken): a renderer that resumes heartbeating during the
recovery window is no longer reloaded on every watchdog tick.
Disposing an outdated (replaced) sidebar view previously wiped the
replacement view's resources and code index manager; scoping the cleanup
to the watched view keeps the replacement intact.1 parent 1e6fd39 commit da8d752
2 files changed
Lines changed: 90 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1146 | 1146 | | |
1147 | 1147 | | |
1148 | 1148 | | |
1149 | | - | |
1150 | | - | |
1151 | 1149 | | |
| 1150 | + | |
| 1151 | + | |
1152 | 1152 | | |
1153 | 1153 | | |
1154 | 1154 | | |
| 1155 | + | |
| 1156 | + | |
1155 | 1157 | | |
1156 | | - | |
1157 | | - | |
1158 | 1158 | | |
1159 | 1159 | | |
1160 | 1160 | | |
| |||
3452 | 3452 | | |
3453 | 3453 | | |
3454 | 3454 | | |
| 3455 | + | |
| 3456 | + | |
| 3457 | + | |
| 3458 | + | |
3455 | 3459 | | |
3456 | 3460 | | |
3457 | | - | |
3458 | | - | |
3459 | | - | |
3460 | | - | |
| 3461 | + | |
| 3462 | + | |
| 3463 | + | |
| 3464 | + | |
| 3465 | + | |
| 3466 | + | |
| 3467 | + | |
| 3468 | + | |
| 3469 | + | |
| 3470 | + | |
| 3471 | + | |
3461 | 3472 | | |
3462 | 3473 | | |
3463 | 3474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
837 | 837 | | |
838 | 838 | | |
839 | 839 | | |
840 | | - | |
841 | | - | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
842 | 844 | | |
843 | | - | |
| 845 | + | |
844 | 846 | | |
845 | 847 | | |
846 | 848 | | |
847 | 849 | | |
848 | 850 | | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
849 | 854 | | |
850 | 855 | | |
851 | 856 | | |
852 | | - | |
| 857 | + | |
853 | 858 | | |
854 | 859 | | |
855 | 860 | | |
| |||
859 | 864 | | |
860 | 865 | | |
861 | 866 | | |
862 | | - | |
863 | | - | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
864 | 872 | | |
865 | | - | |
| 873 | + | |
866 | 874 | | |
867 | 875 | | |
868 | 876 | | |
869 | 877 | | |
870 | 878 | | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
871 | 882 | | |
872 | 883 | | |
873 | 884 | | |
| |||
885 | 896 | | |
886 | 897 | | |
887 | 898 | | |
888 | | - | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
889 | 952 | | |
890 | 953 | | |
891 | 954 | | |
| |||
0 commit comments