Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,8 @@ All notable changes to this project will be documented in this file.

### Fixed

- Fix session binding not updating after provider failover, causing repeated attempts to failed providers (#220) @ding113
- Fix provider availability monitoring page sorting order so high-availability providers rank first (#219) @ding113
- Fix provider daily usage statistics JSONB field name error (#216) @ding113
- Fix response content validation failure in provider testing (#216) @ding113
- Fix login redirect displaying duplicate language prefix (#216) @ding113
- Fix zh-TW missing 8 translation keys for apiTest (#216) @ding113
- Remove DialogContent hardcoded `sm:max-w-lg` width constraint (#216) @ding113
- Fix model test disclaimer display order (#210) @ding113
- Fix provider statistics, group settings persistence, and usage records date filtering; consolidate migrations 0020-0025 into single idempotent file (#207) @ding113
- Fix API action adapter to pass schema params as positional args instead of object (#232) @ding113
- Fix availability monitoring Invalid Date error when selecting 15-minute time range (#231) @ding113
- Fix database migration duplicate enum type creation error (#181) @ding113
- Fix error handling and status codes in response handler, improve user management page UX (#179) @ding113
- Fix infinite loop in leaderboard tab switching (#178) @ding113
Expand Down
8 changes: 6 additions & 2 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { config } from "dotenv";
import { defineConfig } from "drizzle-kit";

// Load environment variables from .env.local
config({ path: ".env.local" });
// Load environment variables following Next.js priority order
// Priority: .env.development.local > .env.local > .env.development > .env
const envFiles = [".env.development.local", ".env.local", ".env.development", ".env"];
for (const envFile of envFiles) {
config({ path: envFile });
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium: dotenv config() priority order is inverted from comment

Why this is a problem: The comment says "Priority: .env.development.local > .env.local > ..." but dotenv.config() by default does NOT override already-set variables. So loading in this order means .env.development.local is loaded first and its values are set, then subsequent files cannot override them. The actual priority is first-file-wins, which matches Next.js priority.

However, if DSN is already set in an earlier file, later files won't override it. Consider whether this is intentional.

Suggested clarification: Update the comment to clarify the "first wins" behavior, or use override: true if you want later files to take precedence:

for (const envFile of envFiles) {
  config({ path: envFile, override: false }); // First file wins (Next.js style)
}

}

export default defineConfig({
out: "./drizzle",
Expand Down
2 changes: 2 additions & 0 deletions drizzle/0021_broad_black_panther.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE "error_rules" ADD COLUMN "override_response" jsonb;--> statement-breakpoint
ALTER TABLE "error_rules" ADD COLUMN "override_status_code" integer;
Loading
Loading