Skip to content

Anirudh fix/phase 0 production readiness - #81

Merged
AnirudhAP2k merged 60 commits into
masterfrom
anirudh_fix/phase-0-production-readiness
Jul 29, 2026
Merged

Anirudh fix/phase 0 production readiness#81
AnirudhAP2k merged 60 commits into
masterfrom
anirudh_fix/phase-0-production-readiness

Conversation

@AnirudhAP2k

@AnirudhAP2k AnirudhAP2k commented Jul 29, 2026

Copy link
Copy Markdown
Owner

User description

Description


PR Type

Enhancement, Bug fix, Tests, Documentation, Configuration changes


Description

  • Rebuilt authentication pages with split-screen layouts and executive branding

  • Added enterprise features including trial expiration jobs and admin grant scripts

  • Refactored middleware routing into modular policy and request handlers

  • Improved database scripts for additive pgvector and reference data seeding


Diagram Walkthrough

flowchart LR
  Auth["Auth Pages & Layouts"] --> Middleware["Modular Middleware Policy"]
  Middleware --> API["API & Mobile Auth Handlers"]
  DB["Database & pgvector"] --> Scripts["Admin & Seeding Scripts"]
  Background["Nightly Trial Expiration"] --> Notifications["Verification Email Templates"]
Loading

File Walkthrough

Relevant files
Enhancement
24 files
RegisterForm.tsx
Update register form with design tokens and loading states
+115/-92
LoginForm.tsx
Rebuild login form using Nexus executive design system     
+89/-73 
org-verification.ts
Add organization verification email template helper           
+151/-0 
page.tsx
Transform register page into split-screen layout with asset highlights
+73/-11 
org-verification.ts
Integrate email notifications into organization verification workflow
+38/-5   
page.tsx
Transform login page into split-screen layout with enterprise features
+68/-11 
expire-trials.ts
Add nightly cron sweep for expiring organization free trials
+99/-0   
grant-admin.ts
Add helper script to grant or revoke app admin privileges
+77/-0   
layout.tsx
Apply executive gradient background and top branding header
+32/-6   
route.ts
Trigger owner notification emails on organization verification actions
+19/-1   
route-policy.ts
Add robust segment-based route matching and classification
+68/-0   
card-wrapper.tsx
Enhance CardWrapper with design system tokens and divider
+17/-7   
actions.ts
Assign 14-day free trial on new organization creation       
+15/-1   
Social.tsx
Format social authentication buttons with Nexus design tokens
+10/-8   
route.ts
Add system health check endpoint for monitoring database reachability
+46/-0   
route.ts
Add trial expiration sweep option to background job trigger API
+14/-2   
api-auth-context.ts
Add Edge-safe API authentication header helper                     
+32/-0   
cron-jobs.ts
Schedule nightly trial expiration cron job                             
+12/-0   
Header.tsx
Update auth header component with executive typography     
+8/-6     
page.tsx
Display trial expiration date on billing settings page     
+2/-1     
back-button.tsx
Style back button component with design system text tokens
+3/-3     
auth-validation.ts
Add edge-safe credentials validation schema for middleware
+15/-0   
stripe.ts
Update Stripe API version header configuration                     
+1/-1     
actions.ts
Add BILLING notification type definition                                 
+2/-1     
Bug fix
10 files
enable-pgvector.ts
Make pgvector setup additive to preserve existing embeddings
+118/-53
useSocket.ts
Refactor socket singleton handling and listener cleanups 
+74/-55 
VerificationForm.tsx
Derive missing verification token without synchronous state
+9/-7     
DateRangeFilter.tsx
Sync date range filter state with URL query parameters     
+26/-16 
JoinVirtualButton.tsx
Move join button callback hooks above conditional early returns
+27/-25 
MessagingSkeletons.tsx
Accept fixed bubble widths to prevent hydration mismatches
+19/-9   
MobileSidebar.tsx
Close mobile sidebar during render on route path changes 
+7/-4     
useEventView.ts
Seed event view refs inside mount effect instead of render
+10/-2   
page.tsx
Replace discover page filter reset link with Next.js Link
+3/-2     
GroupMembersPanel.tsx
Sync group members local state during render on prop updates
+8/-2     
Refactor
14 files
middleware.ts
Delegate middleware route classification to modular handlers
+22/-109
BrainstormChat.tsx
Simplify AI brief extraction condition using message count
+3/-8     
page-access.ts
Extract pure page access decision logic for robust testing
+69/-0   
api-request.ts
Extract API request auth handling into dedicated module   
+39/-0   
OrgAIPanel.tsx
Update AI feature import to use consumeAIFeature action   
+2/-2     
page.tsx
Remove redundant clearRange prop from DateRangeFilter       
+1/-1     
auth.ts
Use constant declarations for cookie store session retrieval
+2/-2     
validation.ts
Re-export LoginSchema from edge-safe validation module     
+2/-8     
actions.ts
Rename useAIFeature action to consumeAIFeature                     
+1/-1     
ai.actions.ts
Export consumeAIFeature from AI server actions                     
+1/-1     
TopHeader.tsx
Declare reminders array as constant in TopHeader                 
+1/-1     
auth.config.ts
Import LoginSchema from edge-safe auth-validation module 
+1/-1     
index.ts
Export consumeAIFeature from AI domain exports                     
+1/-1     
tokens.ts
Use const declaration for cookie store refresh token setting
+1/-1     
Tests
1 files
middleware-policy.test.ts
Add unit tests for middleware routing and access policies
+107/-0 
Configuration changes
8 files
seed.ts
Add database seed script for reference lookup tables         
+99/-0   
routes.ts
Update route definitions and prefixes for unified classification
+11/-23 
index.ts
Add free trial plan and duration constants                             
+15/-0   
tailwind.config.ts
Import tailwindcss-animate directly as ES module                 
+2/-1     
entrypoint.sh
Update container entrypoint script to run pgvector checks and seeding
+24/-11 
eslint.config.mjs
Configure ESLint ignores and loosen specific rules to warnings
+51/-3   
migration.sql
Add migration to remove pgvector indexes from Prisma management
+7/-0     
migration.sql
Add empty migration for smoke testing                                       
+1/-0     
Documentation
2 files
page.tsx
Update pricing page copy regarding 14-day pro trial terms
+2/-2     
README.md
Update README documentation with setup and admin bootstrap steps
+33/-3   
Dependencies
1 files
pnpm-workspace.yaml
Add package overrides and build configurations in workspace
+5/-0     
Additional files
6 files
go_to_market_plan.md +15/-6   
api-auth.ts +0/-31   
next.config.ts +0/-6     
package.json +37/-38 
migration.sql +69/-4   
schema.prisma +9/-0     

…creen layouts with Stitch imagery and brand highlights
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Potential Bug

When the WebSocket token (wsToken) is refreshed by NextAuth but the active organization remains the same, the updated token is ignored because connectSocket immediately returns the existing socketSingleton without updating its authentication options. If the socket subsequently disconnects and attempts to reconnect, it will use the expired token, leading to authentication failures.

function connectSocket(wsUrl: string, wsToken: string, orgId: string): Promise<Socket> {
    // Active org changed — tear the old connection down before opening a new one.
    if (socketSingleton && currentOrgId !== orgId) {
        socketSingleton.disconnect();
        socketSingleton = null;
        currentOrgId = null;
        pendingConnection = null;
    }

    if (socketSingleton) return Promise.resolve(socketSingleton);

    // Concurrent callers await the same in-flight connection rather than each
    // opening their own socket and racing to overwrite the singleton.
    if (!pendingConnection) {
        pendingConnection = import("socket.io-client").then(({ io }) => {
            const socket = io(wsUrl, {
                auth: { token: wsToken },
                transports: ["websocket"],
                reconnection: true,
                reconnectionAttempts: 5,
                reconnectionDelay: 2_000,
            });

            socketSingleton = socket;
            currentOrgId = orgId;
            return socket;
        });
    }

    return pendingConnection;
}

@github-actions

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@AnirudhAP2k
AnirudhAP2k merged commit 0c32637 into master Jul 29, 2026
10 checks passed
@AnirudhAP2k
AnirudhAP2k deleted the anirudh_fix/phase-0-production-readiness branch July 29, 2026 15:13
@AnirudhAP2k

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 1.24.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant