Skip to content

⚡ Bolt: [performance improvement]#59

Open
bobdivx wants to merge 1 commit into
devfrom
bolt-mission-board-promise-all-15927370354759287108
Open

⚡ Bolt: [performance improvement]#59
bobdivx wants to merge 1 commit into
devfrom
bolt-mission-board-promise-all-15927370354759287108

Conversation

@bobdivx
Copy link
Copy Markdown
Owner

@bobdivx bobdivx commented May 23, 2026

💡 What: Grouped 5 independent database queries in getMissionBoardOverview using Promise.all for concurrent execution.
🎯 Why: Previously, the queries (projects, requests, issues, tasks, and conditionally techRows) were executed sequentially, causing a network/I/O waterfall (N+1 query pattern across independent tables).
📊 Impact: Reduces the total wait time for these queries to just the execution time of the longest single query.
🔬 Measurement: Verified that tests (forge-mission-board.test.ts) continue to pass successfully.


PR created automatically by Jules for task 15927370354759287108 started by @bobdivx

Co-authored-by: bobdivx <6737167+bobdivx@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

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

Project Deployment Actions Updated (UTC)
forge Ready Ready Preview, Comment May 23, 2026 5:27pm

@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.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request optimizes the getMissionBoardOverview function by refactoring sequential database queries into a concurrent Promise.all block to reduce total execution time. Feedback suggests adding an explicit orderBy clause to the AgentTask query to ensure deterministic results when applying a limit, maintaining consistency with the other queries in the block.

db.select().from(Project),
db.select().from(Request).orderBy(desc(Request.id)).limit(300),
db.select().from(AgentAppIssue).orderBy(desc(AgentAppIssue.id)).limit(300),
db.select().from(AgentTask).limit(800),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The query for AgentTask is missing an orderBy clause. Without explicit ordering, the limit(800) might return an arbitrary set of records (often the oldest ones) depending on the database engine's implementation. For a mission board that tracks current work, it is important to fetch the most recent tasks to ensure that the mapping between issues and tasks (used later in issueTaskMap) reflects the latest status. Adding orderBy(desc(AgentTask.id)) would make this consistent with the other queries in this block and ensure data freshness.

Suggested change
db.select().from(AgentTask).limit(800),
db.select().from(AgentTask).orderBy(desc(AgentTask.id)).limit(800),

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