Open
Conversation
Reduces rooms list page from 2N+2 HTTP requests to 1 POST request. Backend: POST /v1/rooms/meetings/bulk-status with 3 DB queries total. Frontend: @yornaath/batshit DataLoader-style batcher with 10ms window.
BATSHIT_REPORT.md: full context on bulk query batching — business goal, approach, all changes, verification status, and how to run. FRONTEND_TEST_RESEARCH.md: research on unit testing react-query hooks with jest.mock, renderHook, and batcher testing patterns.
- Fix pnpm version mismatch in test_next_server.yml (8 → auto-detect 10) - Add concurrency group to cancel stale CI runs - Remove redundant setup-node step - Update jest.config.js for jsdom + tsx support - Add meetingStatusBatcher integration test (3 tests) - Extract createMeetingStatusBatcher factory for testability
c9bd667 to
931c344
Compare
- Add max_length=100 on BulkStatusRequest.room_names to prevent abuse - Filter bulk endpoint results to rooms user can see (owned or shared) - Throw on bulk-status fetch error instead of silently returning empty data - Fix room_by_id type annotation: dict[str, DbRoom] instead of Any - Remove stale "200ms" comment in test - Enable strict: true in jest tsconfig - Remove working docs from tracked files - Simplify redundant ternary in test helper
Replace custom meetingStatusKeys with $api.queryOptions()-derived keys so cache identity matches the original per-room GET endpoints.
Contributor
Author
|
self-reviewed |
deardarlingoose
pushed a commit
that referenced
this pull request
Feb 6, 2026
Alternative to the batcher approach (#848): parent fetches all room meeting statuses in a single bulk POST and passes data down as props. No extra dependency (@yornaath/batshit), no implicit batching magic. Backend: POST /v1/rooms/meetings/bulk-status + bulk DB methods. Frontend: useRoomsBulkMeetingStatus hook in RoomList, MeetingStatus receives data as props instead of calling per-room hooks. CI: fix pnpm 8→10 auto-detect, add concurrency group. Tests: Jest+jsdom+testing-library for bulk hook.
Contributor
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
4 tasks
model_validate(from_attributes=True) needed to convert DB Meeting and CalendarEvent to their view-layer Pydantic counterparts.
smankovsky
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
EITHER that PR OR #850
problem: we have performance issues with 100% CPU load
the pr doesn't resolve it. instead, it opens path for resolution in another way: declutter logs, make LLMs stop from hallucinating biasing into "the problem is frontend spamming with those requests"
the long-term effect: mild performance leak mitigation
LLM DESCRIPTION PROOFRED:
Summary
@yornaath/batshitDataLoader pattern (2N+2 requests → 3 requests for N rooms)Backend
POST /v1/rooms/meetings/bulk-statusendpointRoomController.get_by_names(),MeetingController.get_all_active_for_rooms()Frontend
meetingStatusBatcher.ts: DataLoader-style batcher using@yornaath/batshitwith 10ms windowapiHooks.ts:useRoomActiveMeetings/useRoomUpcomingMeetingsnow go through batchermeetingStatusBatcher.test.tsx: integration tests verifying batch collapseCI
.github/workflows/test_next_server.yml: fix pnpm 8→10, add concurrency group, dedupe setup-nodeTest plan
www/**changes)LLM, PROFRED:
Batcher vs rooms: Room[] prop-drilling — trade-offs
Current approach (batcher + per-room hooks):
Alternative (prop-drilling Room[] with meeting status):
Key difference: batcher preserves per-component data ownership (each card manages its own loading/error state). Prop-drilling centralizes it (parent is the single source of truth). For a list page where all cards load together, prop-drilling is simpler. For cases
where room cards appear in varied contexts, the batcher is more flexible
PR Type
Enhancement, Tests
Description
Batch room status queries into single bulk POST
Add frontend test infrastructure with Jest
Fix CI workflow for pnpm version
Implement DataLoader pattern for query batching
Changes walkthrough 📝
6 files
Add bulk meeting status endpointAdd method to get upcoming events for multiple roomsAdd method to get active meetings for multiple roomsAdd method to get rooms by namesRefactor room hooks to use batcherImplement DataLoader-style batcher for meeting status1 files
Add tests for meeting status batcher1 files
Update API types for bulk status endpoint2 files
Configure Jest for React testingFix CI workflow configuration2 files
Add testing dependenciesAdd batshit and testing libraries