Repository navigation
Commit 3dd0854
committed
fix(webview): undo a re-key whose view died before the entry reached a renderer
The review-body ask on rekeyPersistedViewStateEntry measured true: the move was written out
first and only then checked isViewStateGenerationLive, so a view that went away during its own
storage write left the selection under the stable view id that no renderer will ever present,
with the temporary name already deleted. The entry was bound to a claim that never reached a
renderer and nothing on the dead path was rolled back.
The committed move is now undone when the generation is gone: the entry is put back under the
temporary id its author can still find it by and wroteUnderTemporaryViewStateId stays set, so
the next launch re-keys it. When the entry had already been merged into a stable one it cannot
be pulled back out whole, so there the temporary name is gone either way and authorship is
cleared instead - leaving it set would make every later launch claim an entry that no longer
exists under the temporary id. The restore write is best effort: if it fails too the entry
stays under the stable id rather than disappearing. The live path is untouched.
Tests (three cases, two red before the change, one green as the two-sided control):
- view dies during the write, entry moved whole: expects the entry back under the temporary id,
absent under the stable id, authorship still set. Red before: expected undefined to be
'architect'.
- view dies during the write, entry merged into a stable entry: expects the merged entry kept
under the stable id, the temporary id gone, authorship cleared. Red before: expected true to be
false. The generation-mover double delegates to the real setValue so the write still lands.
- generation still live: expects the re-key applied and authorship cleared. Green before and
after, which is what pins the fix to the dead-generation path.
Controls (ClineProvider.ts snapshotted at 4f80687, tsc 0 for each, restored by
content hash after each): neutralise the restore arm -> only the moved-whole case fails
(expected undefined to be 'architect'); drop the authorship clear in the merged branch -> only
the merged case fails (expected true to be false); drop the live path's authorship clear -> only
the live case fails (expected true to be false), so the untouched path is still load-bearing.
Gates: prettier --check clean, tsc --noEmit -p . clean, eslint --max-warnings=0 clean on both
files with eslint-suppressions.json untouched; vitest core/webview + core/config 44 files /
1280 tests green (+3 cases). Scope: extension package 512 changed executable lines
against e943530 (was 494 on the previous head) with the types package at 8; ClineProvider.ts
now 6390 lines. The advisory 500-line cap is a soft ceiling, not a merge blocker.1 parent abe5683 commit 3dd0854
2 files changed
Lines changed: 113 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1105 | 1105 | | |
1106 | 1106 | | |
1107 | 1107 | | |
1108 | | - | |
1109 | | - | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
1110 | 1128 | | |
1111 | 1129 | | |
1112 | 1130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6800 | 6800 | | |
6801 | 6801 | | |
6802 | 6802 | | |
| 6803 | + | |
| 6804 | + | |
| 6805 | + | |
| 6806 | + | |
| 6807 | + | |
| 6808 | + | |
| 6809 | + | |
| 6810 | + | |
| 6811 | + | |
| 6812 | + | |
| 6813 | + | |
| 6814 | + | |
| 6815 | + | |
| 6816 | + | |
| 6817 | + | |
| 6818 | + | |
| 6819 | + | |
| 6820 | + | |
| 6821 | + | |
6803 | 6822 | | |
6804 | 6823 | | |
6805 | 6824 | | |
| |||
6825 | 6844 | | |
6826 | 6845 | | |
6827 | 6846 | | |
| 6847 | + | |
| 6848 | + | |
| 6849 | + | |
| 6850 | + | |
| 6851 | + | |
| 6852 | + | |
| 6853 | + | |
| 6854 | + | |
| 6855 | + | |
| 6856 | + | |
| 6857 | + | |
| 6858 | + | |
| 6859 | + | |
| 6860 | + | |
| 6861 | + | |
| 6862 | + | |
| 6863 | + | |
| 6864 | + | |
| 6865 | + | |
| 6866 | + | |
| 6867 | + | |
| 6868 | + | |
| 6869 | + | |
| 6870 | + | |
| 6871 | + | |
| 6872 | + | |
| 6873 | + | |
| 6874 | + | |
| 6875 | + | |
| 6876 | + | |
| 6877 | + | |
| 6878 | + | |
| 6879 | + | |
| 6880 | + | |
| 6881 | + | |
| 6882 | + | |
| 6883 | + | |
| 6884 | + | |
| 6885 | + | |
| 6886 | + | |
| 6887 | + | |
| 6888 | + | |
| 6889 | + | |
| 6890 | + | |
| 6891 | + | |
| 6892 | + | |
| 6893 | + | |
| 6894 | + | |
| 6895 | + | |
| 6896 | + | |
| 6897 | + | |
| 6898 | + | |
| 6899 | + | |
| 6900 | + | |
| 6901 | + | |
| 6902 | + | |
| 6903 | + | |
| 6904 | + | |
| 6905 | + | |
| 6906 | + | |
| 6907 | + | |
| 6908 | + | |
| 6909 | + | |
| 6910 | + | |
| 6911 | + | |
| 6912 | + | |
| 6913 | + | |
| 6914 | + | |
| 6915 | + | |
| 6916 | + | |
| 6917 | + | |
| 6918 | + | |
| 6919 | + | |
| 6920 | + | |
6828 | 6921 | | |
6829 | 6922 | | |
6830 | 6923 | | |
| |||
0 commit comments