Fix markComplete removal (#874)

MarkComplete is called for every added, removed or changed item found. Therefore it seems odd (ignoring the performance perspective) that we try to remove all items at once. The other cases also only handle one single item at the time. Nevertheless the "remove" case did not behave as expected and did not remove anything from the tag_catalog.

With the code change we now handle one single item at the time and the item is removed from the tag_catalog as expected.

Co-authored-by: Lars Pagh <lp@airsupport.dk>
This commit is contained in:
Lars Pagh 2024-02-21 23:01:56 +01:00 • committed by GitHub
parent be04ff01f8
commit ad219071c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -165,12 +165,14 @@ async function getAddRemoveForTag(
case AddRemoveResultType.Remove:
await db.run(
`DELETE FROM tag_catalog WHERE
path IN (?) AND
cacheKey = ? AND
path = ? AND
dir = ? AND
branch = ? AND
artifactId = ?
`,
remove.map((r) => `'${r.path}'`).join(", "),
cacheKey,
path,
tag.directory,
tag.branch,
tag.artifactId