FileRepository.ListByPrefix selected with path LIKE ? || '%', a string prefix that ignores ASCII case and treats _ and % as wildcards. Restoring /home/u/doc also restored doc2, DOC and doc.txt.bak, and a backup loaded the files of a longer sibling path as known files of this one, then counted them as deleted.
It is now ListUnderPath: the file at the path plus every file whose path starts with the path and /, compared with = and substr, which are case-sensitive and have no wildcards. Restore path arguments and the scanner's known-file load both use it.
What the diff does not show:
A trailing slash on the argument is stripped, so / still lists every file and doc/ lists the same as doc. Restore already cleans its arguments with filepath.Clean.
The subtree half of the query cannot use idx_files_path; the LIKE it replaces could not either.
Three existing tests relied on string-prefix matching (/concurrent-, /tx-test, and an empty prefix over relative paths) and now name a full path or call ListAll.
Judgement call: ListIDsWithChunksNotInUploadedBlobs keeps its LIKE. Its result is only consulted for files found under the scanned path, so the extra IDs it can return are never looked up; changing it is outside the issue.
Judgement call: renamed to ListUnderPath, since the old name describes the string-prefix behaviour that caused the defect.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/vaultik/issues/223.
`FileRepository.ListByPrefix` selected with `path LIKE ? || '%'`, a string prefix that ignores ASCII case and treats `_` and `%` as wildcards. Restoring `/home/u/doc` also restored `doc2`, `DOC` and `doc.txt.bak`, and a backup loaded the files of a longer sibling path as known files of this one, then counted them as deleted.
It is now `ListUnderPath`: the file at the path plus every file whose path starts with the path and `/`, compared with `=` and `substr`, which are case-sensitive and have no wildcards. Restore path arguments and the scanner's known-file load both use it.
What the diff does not show:
- A trailing slash on the argument is stripped, so `/` still lists every file and `doc/` lists the same as `doc`. Restore already cleans its arguments with `filepath.Clean`.
- The subtree half of the query cannot use `idx_files_path`; the `LIKE` it replaces could not either.
- Three existing tests relied on string-prefix matching (`/concurrent-`, `/tx-test`, and an empty prefix over relative paths) and now name a full path or call `ListAll`.
Judgement call: `ListIDsWithChunksNotInUploadedBlobs` keeps its `LIKE`. Its result is only consulted for files found under the scanned path, so the extra IDs it can return are never looked up; changing it is outside the issue.
Judgement call: renamed to `ListUnderPath`, since the old name describes the string-prefix behaviour that caused the defect.
Model: opus-5-5
FileRepository.ListByPrefix matched with SQL LIKE: a plain string
prefix that ignores ASCII case and treats _ and % as wildcards.
Restoring /home/u/doc also restored doc2, DOC and doc.txt.bak, and a
backup counted the files of a longer sibling path as deleted. It is
now ListUnderPath, which returns the file at the path and every file
whose path starts with the path plus a slash, compared exactly. A
trailing slash is ignored, so "/" still lists every file.
Three tests relied on string-prefix matching and now name a full path
or call ListAll.
ListIDsWithChunksNotInUploadedBlobs keeps its LIKE: it only adds file
IDs the scan never looks up.
Model: opus-5-5
Rebased onto current next after #249 landed; the only conflict was TODO.md, resolved by keeping both Completed Steps entries (this one first). Nothing else changed.
Model: opus-5-5
Rebased onto current `next` after https://git.eeqj.de/sneak/vaultik/pulls/249 landed; the only conflict was `TODO.md`, resolved by keeping both Completed Steps entries (this one first). Nothing else changed.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #223.
FileRepository.ListByPrefixselected withpath LIKE ? || '%', a string prefix that ignores ASCII case and treats_and%as wildcards. Restoring/home/u/docalso restoreddoc2,DOCanddoc.txt.bak, and a backup loaded the files of a longer sibling path as known files of this one, then counted them as deleted.It is now
ListUnderPath: the file at the path plus every file whose path starts with the path and/, compared with=andsubstr, which are case-sensitive and have no wildcards. Restore path arguments and the scanner's known-file load both use it.What the diff does not show:
/still lists every file anddoc/lists the same asdoc. Restore already cleans its arguments withfilepath.Clean.idx_files_path; theLIKEit replaces could not either./concurrent-,/tx-test, and an empty prefix over relative paths) and now name a full path or callListAll.Judgement call:
ListIDsWithChunksNotInUploadedBlobskeeps itsLIKE. Its result is only consulted for files found under the scanned path, so the extra IDs it can return are never looked up; changing it is outside the issue.Judgement call: renamed to
ListUnderPath, since the old name describes the string-prefix behaviour that caused the defect.Model: opus-5-5
Review passed.
Model: opus-5-5
bea6c4acectoeca82738afRebased onto current
nextafter #249 landed; the only conflict wasTODO.md, resolved by keeping both Completed Steps entries (this one first). Nothing else changed.Model: opus-5-5
Review passed.
Model: opus-5-5