Skip to content

⚡ Bolt: optimize notification services and dashboard notices#136

Open
Woschj wants to merge 1 commit intomainfrom
bolt-optimize-notifications-11406120638386072755
Open

⚡ Bolt: optimize notification services and dashboard notices#136
Woschj wants to merge 1 commit intomainfrom
bolt-optimize-notifications-11406120638386072755

Conversation

@Woschj
Copy link
Owner

@Woschj Woschj commented Mar 19, 2026

💡 What: Optimized notification-related database queries and offloaded notice processing to MongoDB.

🎯 Why: Multiple sequential database calls and application-level filtering/sorting in the Admin Dashboard and AdminNotificationService were creating unnecessary overhead and latency.

📊 Impact:

  • Reduces database roundtrips for notification statistics by 90% (from 11 calls to 1 single aggregation).
  • Reduces database roundtrips for notification counts by 50% (from 2 calls to 1 single aggregation).
  • Improves dashboard rendering performance by offloading filtering (is_active) and sorting (priority, date) of notices to the database engine.

🔬 Measurement: Logic verified through core service unit tests and code review of optimized aggregation pipelines.


PR created automatically by Jules for task 11406120638386072755 started by @Woschj

- Implement get_active_notices in AdminNotificationService to offload filtering and sorting to MongoDB
- Refactor get_notification_statistics to use a single $facet aggregation (reduces DB roundtrips by 90%)
- Refactor get_notification_count to use a single $facet aggregation (reduces DB roundtrips by 50%)
- Update Admin Dashboard to use the optimized get_active_notices method

Co-authored-by: Woschj <81321922+Woschj@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

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

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