fix: batch room meeting status queries via prop-drilling#850
Draft
deardarlingoose wants to merge 2 commits intomainfrom
Draft
fix: batch room meeting status queries via prop-drilling#850deardarlingoose wants to merge 2 commits intomainfrom
deardarlingoose wants to merge 2 commits intomainfrom
Conversation
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.
- Add PUBLIC_MODE auth guard on bulk-status endpoint - Convert DB models to view models via model_validate() - Early return when no accessible rooms (skip DB queries) - BulkMeetingStatusMap: Partial<Record> for type honesty - Sort roomNames in query key for cache stability - Remove redundant empty-guard in queryFn - Add 7 backend tests: auth, redaction, whereby host_room_url, 401, empty - Add 2 frontend tests: error handling, unauthenticated case
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.
Summary
Alternative to #848 (batcher approach): prop-drilling version that achieves the same N+1 → 1 query reduction without
@yornaath/batshitdependency.POST /v1/rooms/meetings/bulk-statusendpoint + bulk DB methods (get_by_names,get_all_active_for_rooms,get_upcoming_for_rooms)RoomList) fetches all room statuses viauseRoomsBulkMeetingStatus(roomNames)hook, passes data down as props toRoomTable→MeetingStatusProp-drilling vs Batcher trade-offs
@yornaath/batshitDataLoader with 10ms windowuseQuerycall@yornaath/batshitmeetingStatusBatcher.ts$api.queryOptions["bulk-meeting-status", roomNames]Test plan
www/**changes)MeetingSelection.tsxunchanged, uses per-room hook)