Skip to content

🚨 Lighthouse: Parallelize queries in getSchools#218

Open
ldsgroups225 wants to merge 1 commit intomasterfrom
fix/schools-read-waterfall-15299093649235103038
Open

🚨 Lighthouse: Parallelize queries in getSchools#218
ldsgroups225 wants to merge 1 commit intomasterfrom
fix/schools-read-waterfall-15299093649235103038

Conversation

@ldsgroups225
Copy link
Copy Markdown
Owner

@ldsgroups225 ldsgroups225 commented Mar 30, 2026

What

Identified an async waterfall in packages/data-ops/src/queries/schools-read.ts where the school list and the total count were being fetched sequentially. This PR parallelizes these independent database calls using Promise.all().

Why

This follows Lighthouse's core directive to 'Parallelize independent database/API calls with Promise.all()'. Executing these queries concurrently reduces the total response time of the getSchools operation.

Impact

Improved database performance for the getSchools read path, making the operation noticeably faster, which benefits any consumer querying for paginated school lists.


PR created automatically by Jules for task 15299093649235103038 started by @ldsgroups225

Summary by CodeRabbit

  • Chores
    • Optimized the schools data retrieval process to run queries concurrently, improving overall data fetching efficiency.

@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 19340449-a75e-4ffd-9741-c3fb72c4ed7b

📥 Commits

Reviewing files that changed from the base of the PR and between 7e37ef8 and 3ab6ad8.

📒 Files selected for processing (1)
  • packages/data-ops/src/queries/schools-read.ts

📝 Walkthrough

Walkthrough

The getSchools function in the schools-read query module has been optimized to fetch the total count and paginated schools list concurrently using Promise.all, rather than sequentially awaiting the count before executing the list query. The derived calculations and query logic remain unchanged.

Changes

Cohort / File(s) Summary
Schools Query Optimization
packages/data-ops/src/queries/schools-read.ts
Modified getSchools to execute count and list queries concurrently via Promise.all instead of sequential awaiting, improving performance while maintaining the same output behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A query hops faster today,
Two paths run together in parallel play,
Count and list dance side by side,
No waiting for one—they stride with pride!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: parallelizing queries in the getSchools function, which aligns with the primary objective of removing sequential waterfall execution.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/schools-read-waterfall-15299093649235103038

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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