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:
Barrett Ruth 2026-03-17 22:08:21 -04:00
parent e6bbd362bb
commit ba27fe176b
Signed by: barrett
GPG key ID: A6C96C9349D2FC81

View file

@ -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