Fix SQLite crash: don't ORDER BY DateTimeOffset
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:
co-authored by
Claude Opus 4.8
parent
e323a2e882
commit
2ce89fa490
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user