refac: article reads, story delete, no leaks, stored SEO status, rate limit, cleanup (%site%, article repo split, old lang repos, one default per site rule to domain)

This commit is contained in:
Florian Sylvain committed 2026-11-03 16:01:52 +01:00
1 parent 9d284e65a9
commit 7c15206170
85 files changed
+1788 -593

No files matched your search

+9 -6
View File
@@ -628,11 +628,14 @@ func runArticleListLocalization(t *testing.T, open func(*testing.T) *gorm.DB) {
if missing.Total != len(wanted) || missing.Counts["missing"] != len(wanted) || all.Counts["missing"] != len(wanted) {
t.Fatalf("total=%d counts=%v, want %d", missing.Total, missing.Counts, len(wanted))
}
for _, mixed := range []int{31, 33, 35} {
if missing.item(mixed) != nil {
t.Fatalf("story %d holding an unassigned version listed as needing translation", mixed)
for _, mixed := range []int{31, 33} {
if missing.item(mixed) == nil {
t.Fatalf("mixed story %d must be listed as needing translation", mixed)
}
}
if missing.item(35) != nil {
t.Fatal("a story with only an unassigned version must never be listed as needing translation")
}
for _, tag := range []string{"fr", "de", "ar", "en"} {
_, notIn := env.get(localizationOwnerID, "?group=story&lang="+tag+"&tab=missing&size=100")
expected := []int{}
@@ -655,8 +658,8 @@ func runArticleListLocalization(t *testing.T, open func(*testing.T) *gorm.DB) {
env := base(t)
env.siteRepo.lists = 0
_, body := env.get(localizationOwnerID, "?group=story&size=100")
if len(body.Items) == 0 || env.siteRepo.lists != 1 {
t.Fatalf("items=%d site lists=%d, want rows and 1", len(body.Items), env.siteRepo.lists)
if len(body.Items) == 0 || env.siteRepo.lists > 1 {
t.Fatalf("items=%d site lists=%d, want rows and at most 1", len(body.Items), env.siteRepo.lists)
}
})
@@ -697,7 +700,7 @@ func runArticleListLocalization(t *testing.T, open func(*testing.T) *gorm.DB) {
})
t.Run("Repository failure answers 500", func(t *testing.T) {
for _, method := range []string{"FindStoryPage", "CountStories", "FindPage"} {
for _, method := range []string{"FindStoryPage", "CountStories", "ListVersions"} {
env := base(t)
env.repo.failMethod = method
rec, _ := env.get(localizationOwnerID, "?group=story")