feat(backend): implement session coverage, resumable ingestion, deep year backfill, backoff rate-limit, and dynamic cache TTLs

This commit is contained in:
2026-05-25 13:52:43 -04:00
parent bc1c551a82
commit 937674f808
9 changed files with 731 additions and 50 deletions

View File

@@ -28,8 +28,8 @@ func TestOpenAppliesMigrations(t *testing.T) {
if err != nil {
t.Fatalf("SchemaVersion() error = %v", err)
}
if version != 3 {
t.Fatalf("SchemaVersion() = %d, want 3", version)
if version != 4 {
t.Fatalf("SchemaVersion() = %d, want 4", version)
}
tables := []string{
@@ -50,6 +50,7 @@ func TestOpenAppliesMigrations(t *testing.T) {
"laps",
"news_sources",
"news_items",
"session_coverage",
}
for _, table := range tables {
var name string
@@ -92,6 +93,12 @@ func TestMigrationsAreIdempotent(t *testing.T) {
if count != 1 {
t.Fatalf("schema_migrations v3 count = %d, want 1", count)
}
if err := s.db.QueryRow(`SELECT COUNT(*) FROM schema_migrations WHERE version = 4`).Scan(&count); err != nil {
t.Fatalf("count schema_migrations v4: %v", err)
}
if count != 1 {
t.Fatalf("schema_migrations v4 count = %d, want 1", count)
}
}
func TestRawPayloadInsertAndRead(t *testing.T) {