fix(ftp): use nil entry ID so cache assigns unique IDs
Problem: `M.list` returned entries as `{0, name, type, meta}`.
`cache.store_entry` only assigns a fresh ID when `entry[FIELD_ID] == nil`;
passing 0 caused every entry to be stored as ID 0, all overwriting
each other. `get_entry_by_id(0)` then always returned the last-stored
entry, breaking navigation (always opened the same file), rename
(wrong entry matched), and create (wrong diff).
Solution: change the placeholder from 0 to nil, matching how
`cache.create_entry` itself builds entries.
This commit is contained in:
parent
e6bbd362bb
commit
ba27fe176b
1 changed files with 1 additions and 1 deletions
|
|
@ -407,7 +407,7 @@ M.list = function(url, column_defs, callback)
|
||||||
name, entry_type, meta = parse_iis_list_line(line)
|
name, entry_type, meta = parse_iis_list_line(line)
|
||||||
end
|
end
|
||||||
if name and entry_type and name ~= '.' and name ~= '..' then
|
if name and entry_type and name ~= '.' and name ~= '..' then
|
||||||
table.insert(entries, { 0, name, entry_type, meta })
|
table.insert(entries, { nil, name, entry_type, meta })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue