Skip to content

Commit 47881a6

Browse files
committed
fix: show original if config unavailable
1 parent 68c3c5e commit 47881a6

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

app/api/ab-config/route.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,7 @@ export async function GET() {
7878
`[AB Config] All API methods failed. Last error: ${apiError}`
7979
)
8080

81-
const fallbackConfig = {
82-
AppTest: {
83-
id: "1",
84-
enabled: true,
85-
variants: [
86-
{ name: "Original", weight: 50 },
87-
{ name: "Variation1", weight: 50 },
88-
],
89-
},
90-
}
81+
const fallbackConfig = {}
9182

9283
return NextResponse.json(fallbackConfig, {
9384
headers: {

src/lib/ab-testing/config.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,8 @@ async function fetchConfigFromAPI(): Promise<Record<string, ABTestConfig>> {
3333
}
3434

3535
function getFallbackConfig(): Record<string, ABTestConfig> {
36-
// Fallback configuration when API fails
37-
return {
38-
AppTest: {
39-
name: "AppTest",
40-
id: "fallback",
41-
enabled: true,
42-
variants: [
43-
{ name: "Original", weight: 50 },
44-
{ name: "Variation1", weight: 50 },
45-
],
46-
},
47-
}
36+
// Fallback configuration when API fails - show original 100% of the time
37+
return {}
4838
}
4939

5040
function getPreviewConfig(): Record<string, ABTestConfig> {

0 commit comments

Comments
 (0)