Commit 873f110
committed
Bugfix: MTP
`MtpVolume::write_from_stream`'s belt-and-suspenders cache patch was silently no-op because the parent path we threaded into `notify_directory_changed` was the volume-relative form callers handed us (`/file-a.txt` after the cross-volume orchestrator did `dest_path.join(name)` with `dest_path = "/"`), while every cached listing on `LISTING_CACHE` stores the absolute MTP URL form (`mtp://{device}/{storage}/...`). `find_listings_for_path_on_volume` matches by exact path equality, so the lookup missed every time and the destination pane stayed stale until the lossy MTP USB event loop caught up — which on many devices it never does.
Add `MtpVolume::to_url_path` as the inverse of `to_mtp_path` and run every caller-supplied path through it at the top of `notify_mutation`, including the `get_metadata` lookup for the new/renamed entry. Every existing call site (`create_directory`, `delete`, `rename` cross-/same-dir, `write_from_stream`) benefits because they all funnel through the same trait method.
Confirmed via tempdebug logging on a local-to-MTP copy: pre-fix `listings_matched=0` (and only the FS-watcher fallback could rescue the pane); post-fix the lookup finds the right listing and the file appears in the destination pane immediately.notify_mutation matches cached listings again1 parent e852f04 commit 873f110
1 file changed
Lines changed: 34 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
94 | 118 | | |
95 | 119 | | |
96 | 120 | | |
| |||
256 | 280 | | |
257 | 281 | | |
258 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
259 | 288 | | |
260 | 289 | | |
261 | 290 | | |
262 | 291 | | |
263 | 292 | | |
264 | | - | |
| 293 | + | |
265 | 294 | | |
266 | 295 | | |
267 | 296 | | |
268 | 297 | | |
269 | 298 | | |
270 | 299 | | |
271 | 300 | | |
272 | | - | |
| 301 | + | |
273 | 302 | | |
274 | 303 | | |
275 | 304 | | |
| |||
281 | 310 | | |
282 | 311 | | |
283 | 312 | | |
284 | | - | |
| 313 | + | |
285 | 314 | | |
286 | 315 | | |
287 | | - | |
| 316 | + | |
288 | 317 | | |
289 | 318 | | |
290 | 319 | | |
291 | 320 | | |
292 | | - | |
| 321 | + | |
293 | 322 | | |
294 | 323 | | |
295 | 324 | | |
| |||
0 commit comments