Skip to content

perf: speed up assessment authoring and management flows - #32

Merged
RogutKuba merged 2 commits into
mainfrom
RogutKuba/churn-feedback-summary
Jul 25, 2026
Merged

perf: speed up assessment authoring and management flows#32
RogutKuba merged 2 commits into
mainfrom
RogutKuba/churn-feedback-summary

Conversation

@RogutKuba

Copy link
Copy Markdown
Member

Addresses the churn feedback that CoderScreen felt slow when creating tests and managing assessments, fixing the root causes rather than symptoms. Adds the missing DB indexes on the FK/org columns that every assessment query filters and joins on (previously sequential scans), applied via db:push. Fixes the listSubmissions N+1 and batches the remaining per-question loops in inviteCandidate, getSubmissionDetails, getSubmissionByToken, and computeWeightedAggregate. On the frontend, test-case add/edit/delete now patch the React Query cache from the mutation response and question reorder is optimistic, so authoring no longer re-pulls the entire assessment on every edit (signature-affecting mutations still invalidate, since the server cascades test-case deletion). API type-checks clean and no new web type errors are introduced.

🤖 Generated with Claude Code

Address the two slowness complaints from churn feedback (creating tests,
managing assessments) at their root:

- Add DB indexes on the FK/org columns every assessment query filters and
  joins on (assessments, assessment_questions, question_library,
  question_library_test_cases, question_submissions, test_case_results).
  These were sequential scans before. Applied via `db:push`.
- Fix listSubmissions N+1: fetch candidates in one inArray query instead of
  one round-trip per submission.
- Stop the full-assessment refetch on every authoring edit: test-case
  add/edit/delete now patch the query cache from the mutation response, and
  question reorder is optimistic. Signature-affecting mutations still
  invalidate (server cascades test-case deletion).
- Batch remaining N+1 loops: inviteCandidate inserts, getSubmissionDetails,
  getSubmissionByToken, and computeWeightedAggregate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 25, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
coderscreen-marketing Ready Ready Preview, Comment Jul 25, 2026 10:46pm

Request Review

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 25, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
coderscreen-api 2cbf217 Jul 25 2026, 10:46 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 25, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
coderscreen-web 2cbf217 Jul 25 2026, 10:46 PM

The Hono RPC client infers the PATCH test-case response as `never`, so
reading `.id` off it broke `tsc` in the full build (where the api types
resolve). Pin the fields the cache operations read via a CachedTestCase
type. Isolated web tsc missed this because it degrades RPC types to any.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@RogutKuba
RogutKuba merged commit 1343d0c into main Jul 25, 2026
5 checks passed
@RogutKuba
RogutKuba deleted the RogutKuba/churn-feedback-summary branch July 25, 2026 22:52
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.

1 participant