Skip to content

ADR — PR #1021

2026-05-19 10:00 — Fixed unsafe cast in ProvisionStep2.tsx

Section titled “2026-05-19 10:00 — Fixed unsafe cast in ProvisionStep2.tsx”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: The unsafe cast in the onChange handler was replaced with the explicit inbox provider union type to ensure type safety.

2026-05-19 10:05 — Moved uuid from devDependencies to dependencies

Section titled “2026-05-19 10:05 — Moved uuid from devDependencies to dependencies”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: The uuid package was moved from devDependencies to dependencies as it is required at runtime by the server route.

2026-05-19 10:10 — Converted ProvisionStep1 to React component

Section titled “2026-05-19 10:10 — Converted ProvisionStep1 to React component”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: The ProvisionStep1 function component was converted to a React component to ensure compatibility with the Astro framework.

2026-05-19 10:15 — Converted ProvisionStep2 to React component

Section titled “2026-05-19 10:15 — Converted ProvisionStep2 to React component”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: The ProvisionStep2 function component was converted to a React component to ensure compatibility with the Astro framework.

2026-05-19 10:20 — Converted ProvisionStep3 to React component

Section titled “2026-05-19 10:20 — Converted ProvisionStep3 to React component”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: The ProvisionStep3 function component was converted to a React component to ensure compatibility with the Astro framework.

2026-05-19 10:25 — Added CSRF protection to orgs/create.ts

Section titled “2026-05-19 10:25 — Added CSRF protection to orgs/create.ts”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: CSRF protection was added to the orgs/create.ts endpoint to ensure the security of the application.

2026-05-19 10:30 — Added transaction to orgs/create.ts

Section titled “2026-05-19 10:30 — Added transaction to orgs/create.ts”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: A transaction was added to the orgs/create.ts endpoint to ensure data consistency.

2026-05-19 10:35 — Added CSRF protection to orgs/draft.ts

Section titled “2026-05-19 10:35 — Added CSRF protection to orgs/draft.ts”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: CSRF protection was added to the orgs/draft.ts endpoint to ensure the security of the application.

2026-05-19 10:40 — Added atomic upsert to orgs/draft.ts

Section titled “2026-05-19 10:40 — Added atomic upsert to orgs/draft.ts”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: An atomic upsert was added to the orgs/draft.ts endpoint to ensure data consistency.

2026-05-19 10:45 — Fixed redirect in orgs/new.astro

Section titled “2026-05-19 10:45 — Fixed redirect in orgs/new.astro”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: The redirect in the orgs/new.astro file was fixed to ensure the correct organization slug is used.

2026-05-19 10:50 — Added CSRF token to orgs/new.astro

Section titled “2026-05-19 10:50 — Added CSRF token to orgs/new.astro”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: A CSRF token was added to the orgs/new.astro file to ensure the security of the application.

2026-05-19 10:55 — Added timeout to orgs/new.astro

Section titled “2026-05-19 10:55 — Added timeout to orgs/new.astro”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: A timeout was added to the orgs/new.astro file to ensure the application does not hang indefinitely.

2026-05-19 11:00 — Updated Organization.status type in org-draft.ts

Section titled “2026-05-19 11:00 — Updated Organization.status type in org-draft.ts”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: The Organization.status type in the org-draft.ts file was updated to include the actual persisted values.

2026-05-19 11:05 — Removed redundant indexes in 0057_fat_nicolaos.sql

Section titled “2026-05-19 11:05 — Removed redundant indexes in 0057_fat_nicolaos.sql”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: Redundant indexes were removed from the 0057_fat_nicolaos.sql file to ensure data consistency.

2026-05-19 11:10 — Added unique index to org-drafts.ts

Section titled “2026-05-19 11:10 — Added unique index to org-drafts.ts”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: A unique index was added to the org-drafts.ts file to ensure data consistency.

2026-05-19 11:15 — Changed userId column type in org-drafts.ts

Section titled “2026-05-19 11:15 — Changed userId column type in org-drafts.ts”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: The userId column type in the org-drafts.ts file was changed to text to ensure compatibility with Clerk user IDs.

2026-05-19 11:20 — Removed redundant indexes in organizations.ts

Section titled “2026-05-19 11:20 — Removed redundant indexes in organizations.ts”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: Redundant indexes were removed from the organizations.ts file to ensure data consistency.

2026-05-19 11:25 — Changed createdBy column type in organizations.ts

Section titled “2026-05-19 11:25 — Changed createdBy column type in organizations.ts”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: The createdBy column type in the organizations.ts file was changed to text to ensure compatibility with Clerk user IDs.

2026-05-20 09:00 — Fixed userEmail ordering in create.ts transaction

Section titled “2026-05-20 09:00 — Fixed userEmail ordering in create.ts transaction”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: Moved userEmail fetch before the transaction block so it’s available inside, and removed the duplicate createOrganizationAuditLog call outside the transaction that would have created a redundant audit entry.

2026-05-20 09:05 — Fixed CSRF token handling in new.astro

Section titled “2026-05-20 09:05 — Fixed CSRF token handling in new.astro”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: Added crypto.getRandomValues-based CSRF token generation (matching onboarding/organization.astro pattern), X-Requested-With header to match validateCSRF expectations, AbortController to saveDraft fetch, and optional chaining guard on redirect slug lookup.

2026-05-20 09:10 — Removed redundant indexes from migration SQL

Section titled “2026-05-20 09:10 — Removed redundant indexes from migration SQL”
  • Comment: CodeRabbit comment
  • Priority: must-fix
  • Decision: accept
  • Rationale: Removed orgs_slug_idx and orgs_clerk_org_idx CREATE INDEX statements from the migration SQL since unique constraints on slug and clerkOrganizationId already create btree indexes.