diff --git a/src/SIL.Harmony/Db/CrdtRepository.cs b/src/SIL.Harmony/Db/CrdtRepository.cs index 0636008..8358e72 100644 --- a/src/SIL.Harmony/Db/CrdtRepository.cs +++ b/src/SIL.Harmony/Db/CrdtRepository.cs @@ -58,7 +58,7 @@ public IQueryable CurrentCommits() public IQueryable CurrentSnapshots() { - //todo this does not respect ignoreChangesAfter + var ignoreDate = ignoreChangesAfter?.UtcDateTime; return _dbContext.Snapshots.FromSql( $""" WITH LatestSnapshots AS (SELECT first_value(s1.Id) @@ -68,7 +68,7 @@ PARTITION BY "s1"."EntityId" ) AS "LatestSnapshotId" FROM "Snapshots" AS "s1" INNER JOIN "Commits" AS "c" ON "s1"."CommitId" = "c"."Id" - WHERE "c"."DateTime" < {ignoreChangesAfter?.UtcDateTime} OR {ignoreChangesAfter} IS NULL) + WHERE "c"."DateTime" < {ignoreDate} OR {ignoreDate} IS NULL) SELECT * FROM "Snapshots" AS "s" INNER JOIN LatestSnapshots AS "ls" ON "s"."Id" = "ls"."LatestSnapshotId"