Commit dda4151
fix(desktop): keep the atomic-save retry off non-file targets
The retry after a failed rename exists for Windows, which may refuse to
replace an existing file. It removed the target unconditionally through
`remove_if_exists`, which deletes a directory recursively — so a path
occupied by a directory (`.openseek/worktrees.json/`, say) was erased
along with everything under it, and the write then reported success.
This was inherited from `write_settings_file`, but promoting it into a
shared helper spread it to the workspace and worktree registries.
Restrict the retry to a regular file at the target and re-raise the
original rename failure otherwise, so a wrong path is reported rather
than cleared.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent de080ae commit dda4151
1 file changed
Lines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
102 | 112 | | |
103 | 113 | | |
104 | 114 | | |
| |||
166 | 176 | | |
167 | 177 | | |
168 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
169 | 197 | | |
170 | 198 | | |
171 | 199 | | |
| |||
0 commit comments