Repository navigation
perf: ⚡️ speed up the Hono API, data loading and React rendering across the repo - #885
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b67a8070a
ℹ️ 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".
9b67a80 to
7e73002
Compare
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
7e73002 to
603871f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 603871f64d
ℹ️ 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".
…ss the repo API - SSR hands API calls to the in-process Hono app instead of looping over HTTP - withPagination runs the count and the page query in parallel - in-memory LRU cache (15s TTL cap) when Redis is not configured - fewer and parallel staff-permission queries, per-request device/epoch memos - core middleware object built once at boot; event listeners indexed by name - timeouts on captcha, SSO, cron and storage fetches - hono/compress on the standalone API, pre-compressed static assets - queue drains batches with limited concurrency, set-based status updates - emails processed right after the response, pooled SMTP transport - cron jobs claimed atomically so multi-instance deploys run them once - websocket: stringify once, user/room indexes, heartbeat, client backoff - notifications: skip recipientIds on read paths, sliced fanout, seekable inbox cursor, cached admin overview totals - search: bulk upsert, container deletes in one statement, capped ES totals - AI policies and action settings resolved in batches - indexes for roleId, session expiry, delivery eventId, queue retention, AI history, user files and the moderation queue Content Engine - never-public draft edits no longer expire the public page cache - generation-keyed public list/detail cache, cached container trees - parallel hydration, optional publicApi.listFields, narrow delivery metadata - concurrent write effects, dependent search reindex on the queue Web - session refresh no longer blocks navigation; 75ms intent preload - profile timeline streams from the loader; cached llms/docs text - AutoForm memoizes its schema, WAAPI shake instead of motion - visual editor split contexts and memoized blocks; debounced TipTap onChange - dnd-kit lazy-loaded only for reorderable tables - marketing.css loaded per route; no transition-all; cheaper glows - forum: cached stats, topics with stats in one request, lazy composer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BpbpzvNwCm19By2HEKWq7d
603871f to
b1978bb
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1978bbf87
ℹ️ 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".
- queue: save each task's result as it finishes, fenced by its claim, so a slow sibling can't push finished tasks past their lease - search: delete from the provider before the canonical rows, so a failed provider call stays retryable - content cache: the public generation bump rethrows a failed write, so invalidation retries instead of serving the old generation - email/notifications: run after-response delivery on the request's waitUntil where the runtime provides one (web bridge, in-process SSR) - api: give JSON responses a Content-Length so compress() skips small bodies - create-vitnode-app: register the in-process API like apps/web Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BpbpzvNwCm19By2HEKWq7d
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19a4c02017
ℹ️ 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".
|
|
||
| // Without Redis, sessions, devices and staff permissions would otherwise hit | ||
| // the database on every request. One store per app, shared by its requests. | ||
| const memoryCache = cacheClient ? null : new MemoryCacheStore(); |
There was a problem hiding this comment.
Keep no-Redis domain caching disabled
When multiple API instances run without REDIS_URL, this creates independent process-local caches: a staff-permission grant cached on instance B is not cleared when a permission removal is handled by instance A, so B can continue authorizing the removed grant for up to the 15-second memory TTL. Leave CacheModel unbacked in this configuration or add shared invalidation; the repository explicitly defines domain caching as a no-op when Redis is absent.
AGENTS.md reference: AGENTS.md:L53-L53
Useful? React with 👍 / 👎.
| const requestedOffset = | ||
| requestedPage === undefined ? 0 : (requestedPage - 1) * pageSize; | ||
| const [totalCount, speculativeEdges] = await Promise.all([ | ||
| fetchTotalCount(c, table, baseWhere), | ||
| pageAt(requestedOffset), |
There was a problem hiding this comment.
Clamp numbered pages before issuing the OFFSET query
For any numbered-pagination endpoint, page accepts values up to Number.MAX_SAFE_INTEGER, so a request such as page=9007199254740991 now starts an enormous OFFSET query before the count is known. PostgreSQL must scan and discard the matching rows, and after the count clamps the page this code issues another page query, turning an otherwise cheap out-of-range request into multiple full scans; count and clamp numbered pages before starting their row query, or bound the page number.
Useful? React with 👍 / 👎.
| * instances can never point reads back at an older generation. | ||
| */ | ||
| export const invalidateForumStats = async (c: Context): Promise<void> => { | ||
| await c.get("cache").setSystem(GENERATION_KEY, randomUUID()); |
There was a problem hiding this comment.
Propagate forum generation write failures
When Redis transiently rejects this new forum-generation write, the default setSystem path catches the error and resolves, so the event listener reports successful invalidation while readers keep using the old forum/topic counts and latest-topic data for the full 300-second TTL. Use the strict cache-write option here so the existing event failure handling can observe and retry the invalidation.
Useful? React with 👍 / 👎.
API
inbox cursor, cached admin overview totals
AI history, user files and the moderation queue
Content Engine
Web
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01BpbpzvNwCm19By2HEKWq7d