Fix SQLite crash: don't ORDER BY DateTimeOffset
Build & Push Docker image / test (push) Successful in 47s
Build & Push Docker image / docker (push) Successful in 1m19s

SQLite can't translate ORDER BY on DateTimeOffset columns, so loading the
wishlists/invites pages threw NotSupportedException. Order by the autoincrement
Id (same newest-first result) instead. Add a regression test that exercises the
owned/shared list queries against SQLite.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Jim Basso
2026-06-11 15:36:28 -05:00
co-authored by Claude Opus 4.8
parent e323a2e882
commit 2ce89fa490
4 changed files with 15 additions and 3 deletions
@@ -144,5 +144,17 @@ public class WishlistServiceTests : IDisposable
Assert.NotNull(await _svc.GetDetailAsync(1, OwnerId)); // owner always
}
[Fact]
public async Task Owned_and_shared_list_queries_run_on_sqlite()
{
// Regression: these order by a timestamp; SQLite can't ORDER BY DateTimeOffset, so the
// service must order by a supported column. This would throw NotSupportedException otherwise.
var owned = await _svc.GetOwnedAsync(OwnerId);
Assert.Single(owned);
var shared = await _svc.GetSharedWithAsync(FriendId);
Assert.Single(shared); // the AllMembers list is visible to other members
}
public void Dispose() => _db.Dispose();
}