Skip to content

Update Feb 17#194

Merged
Deodat-Lawson merged 13 commits intostablefrom
main
Feb 17, 2026
Merged

Update Feb 17#194
Deodat-Lawson merged 13 commits intostablefrom
main

Conversation

@Deodat-Lawson
Copy link
Owner

No description provided.

@vercel
Copy link

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pdr-ai-v2 Ready Ready Preview, Comment Feb 17, 2026 4:33pm

@Deodat-Lawson Deodat-Lawson merged commit 43ece19 into stable Feb 17, 2026
3 of 4 checks passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3dc4a9e3d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +34 to +38
return runDocIngestionTool({
...eventData,
runtime: {
updateJobStatus: false,
markFailureInDb: false,

Choose a reason for hiding this comment

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

P1 Badge Throw on failed ingestion so Inngest retries execute

This function is configured with retries: 5, but it now directly returns runDocIngestionTool(...), which catches internal errors and returns { success: false } instead of throwing (see src/lib/tools/doc-ingestion/index.ts catch path). In failure scenarios like sidecar/embed outages or DB write errors, Inngest will treat the run as successful, so retries and onFailure handling are skipped and the document pipeline can silently stop without recovery.

Useful? React with 👍 / 👎.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3dc4a9e3d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +66 to +68
if (cached.expiresAt < Date.now()) {
middlewareUserCache.delete(userId);
return undefined;

Choose a reason for hiding this comment

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

P2 Badge Evict expired middleware cache entries proactively

This cache currently removes stale entries only when the same userId is requested again, so users who do not return after their first hit remain in memory indefinitely. In a long-lived Node middleware process, each distinct verified user adds a retained map entry, which can cause unbounded memory growth over time; add periodic cleanup or size-bounded eviction so expired entries are removed even without future lookups.

Useful? React with 👍 / 👎.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3dc4a9e3d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +105 to +107
const cachedUser = getCachedMiddlewareUser(userId);
let existingUser = cachedUser;
if (cachedUser === undefined) {

Choose a reason for hiding this comment

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

P1 Badge Recheck role/status before authorizing protected routes

This middleware now trusts a cached user record before hitting the database, so role/status changes are not enforced until the 10s TTL expires. If an admin demotes a user or marks them unverified, requests during that window are still authorized using stale role/status and can continue through protected /employer or /employee paths. Previously each request re-read the DB, so revocations took effect immediately.

Useful? React with 👍 / 👎.

import { drizzle } from "drizzle-orm/postgres-js";

// Lightweight db client for hot API routes that do not need schema-wide typing.
const coreClient = postgres(process.env.DATABASE_URL!, { max: 10 });

Choose a reason for hiding this comment

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

P2 Badge Reuse the existing Postgres pool for core DB access

This introduces a second postgres() pool (max: 10) even though src/server/db/index.ts already creates its own max: 10 pool. In long-lived Next.js server processes that load both modules, connection usage doubles per process and can hit database connection limits under traffic. Reusing a shared client/pool avoids unnecessary connection pressure.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants