Commit dfc0002
authored
perf(meetings): eliminate N+1 committee fetches and count endpoints for project meetings (#1076)
* perf(meetings): eliminate N+1 committee fetches and add project meetings count endpoints LFXV2-2120
Win 2 — server-side batch committee name lookup:
- committee.service.ts: make getCommitteesByIds public so meeting.service can use it
- meeting.service.ts: rewrite getCommitteeNameMap to use a single batched query-service
call (OR-tag pattern) instead of N sequential getCommitteeById calls; only committee.name
is needed so the heavyweight getCommitteeById (settings + membership + access checks) is
no longer invoked per meeting
Win 1 — project meetings stat cards via count endpoints:
- past-meeting.controller.ts: add getPastMeetingsCount (GET /past-meetings/count) backed by
getMeetingsCount with type=v1_past_meeting
- past-meetings.route.ts: register /count route before /:uid to avoid param capture
- meeting.service.ts (frontend): add getPastMeetingsCountByProject calling the new endpoint
- meetings-dashboard.component.ts: replace rawFpUpcomingMeetings().length and
rawFpPastMeetings().length with dedicated count signals (initFpUpcomingCount /
initFpPastCount) that call the count API directly; per-card loading signals
(fpUpcomingCountLoading, fpPastCountLoading) so count cards resolve on one fast API call
rather than waiting for all paginated pages
- meetings-dashboard.component.html: update count-card guards to use per-card loading;
recurring/recordings cards keep fpStatsLoading (tied to the raw full-page fetch they need)
Signed-off-by: Rashad <mrashad@contractor.linuxfoundation.org>
* fix(review): move getCommitteesByIds before private methods per member-ordering lint rule LFXV2-2120
@typescript-eslint/member-ordering requires public methods to be declared
before private methods. getCommitteesByIds was positioned after private
methods; move it to immediately before the private section.
Signed-off-by: Rashad <mrashad@contractor.linuxfoundation.org>
* fix(review): address PR #1076 CodeRabbit review feedback LFXV2-2120
Address review comments from @coderabbitai:
- meetings-dashboard.component.ts: extract shared initFpCount() helper to
eliminate duplicate initFpUpcomingCount/initFpPastCount implementations;
add loadingSignal.set(false) in early-return branch to prevent stuck skeleton
(per Thread 2); add Observable to rxjs imports
- apps/shared/services/meeting.service.ts: extract private getCountByTag()
helper; consolidate getMeetingsCountByCommittee, getMeetingsCountByProject,
getPastMeetingsCountByProject to delegate to it; move getCountByTag after
all public methods to satisfy @typescript-eslint/member-ordering (per Thread 4)
- server/services/meeting.service.ts: rewrite getCommitteeNameMap() with
Promise.allSettled directly (bypassing getCommitteesByIds) so a single batch
failure degrades gracefully instead of wiping all committee names (per Thread 3)
Resolves 3 CodeRabbit review threads (Thread 2, 3, 4).
Thread 1 (count alignment) is a false positive — responded with explanation.
Signed-off-by: Rashad <mrashad@contractor.linuxfoundation.org>
* fix(review): address PR #1076 iteration-2 review feedback LFXV2-2120
Address review comments from @audigregorie, @copilot-pull-request-reviewer,
@ahmedomosanya:
- meetings-dashboard.component.ts: add catchError(() => of(0)) before finalize
in initFpCount — defense-in-depth matching the pattern in
initializeRawFpUpcomingMeetings (per @audigregorie)
- committee.service.ts: revert getCommitteesByIds from public back to private
— getCommitteeNameMap in meeting.service.ts intentionally reimplements the
batch fetch with Promise.allSettled (partial failure tolerance) rather than
calling getCommitteesByIds which uses fail-fast Promise.all; the public
modifier was misleading since no external caller materialised
(per @copilot-pull-request-reviewer, @audigregorie)
- meeting.service.ts: add comment documenting expected cardinality bound
(≤1 batch in practice for a project's displayed meetings)
(per @ahmedomosanya)
Resolves 4 review threads.
Signed-off-by: Rashad <mrashad@contractor.linuxfoundation.org>
* fix(review): address PR #1076 review feedback
Address review comment from @copilot-pull-request-reviewer:
- server/services/meeting.service.ts:1445: remove redundant new Set()
wrap on uniqueCommitteeUids — the array is already deduplicated via
[...new Set(...)] at line 1429; only .filter(Boolean) adds value
Resolves 1 review thread. LFXV2-2120
Signed-off-by: Rashad <mrashad@contractor.linuxfoundation.org>
* fix(review): address PR #1076 review feedback
Address review comment from @copilot-pull-request-reviewer:
- server/services/meeting.service.ts: remove stale CommitteeService
dependency — getCommitteeNameMap now uses microserviceProxy directly
so committeeService import, field, and constructor instantiation are
all dead code; removed all three
Resolves 1 review thread. LFXV2-2120
Signed-off-by: Rashad <mrashad@contractor.linuxfoundation.org>
---------
Signed-off-by: Rashad <mrashad@contractor.linuxfoundation.org>1 parent 7002010 commit dfc0002
7 files changed
Lines changed: 170 additions & 93 deletions
File tree
- apps/lfx-one/src
- app
- modules/meetings/meetings-dashboard
- server
- controllers
- routes
- services
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
Lines changed: 41 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| |||
228 | 230 | | |
229 | 231 | | |
230 | 232 | | |
231 | | - | |
232 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
233 | 236 | | |
234 | | - | |
235 | | - | |
| 237 | + | |
| 238 | + | |
236 | 239 | | |
237 | 240 | | |
238 | 241 | | |
| |||
779 | 782 | | |
780 | 783 | | |
781 | 784 | | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
782 | 819 | | |
783 | 820 | | |
784 | 821 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 116 | + | |
124 | 117 | | |
125 | 118 | | |
126 | 119 | | |
| |||
147 | 140 | | |
148 | 141 | | |
149 | 142 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
163 | 148 | | |
164 | 149 | | |
165 | 150 | | |
| |||
602 | 587 | | |
603 | 588 | | |
604 | 589 | | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
605 | 601 | | |
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
56 | 74 | | |
57 | 75 | | |
58 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1329 | 1329 | | |
1330 | 1330 | | |
1331 | 1331 | | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
1332 | 1382 | | |
1333 | 1383 | | |
1334 | 1384 | | |
| |||
1419 | 1469 | | |
1420 | 1470 | | |
1421 | 1471 | | |
1422 | | - | |
1423 | | - | |
1424 | | - | |
1425 | | - | |
1426 | | - | |
1427 | | - | |
1428 | | - | |
1429 | | - | |
1430 | | - | |
1431 | | - | |
1432 | | - | |
1433 | | - | |
1434 | | - | |
1435 | | - | |
1436 | | - | |
1437 | | - | |
1438 | | - | |
1439 | | - | |
1440 | | - | |
1441 | | - | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | | - | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
1460 | | - | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
1464 | | - | |
1465 | | - | |
1466 | | - | |
1467 | | - | |
1468 | | - | |
1469 | | - | |
1470 | | - | |
1471 | | - | |
1472 | 1472 | | |
1473 | 1473 | | |
1474 | 1474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
68 | | - | |
69 | 67 | | |
70 | 68 | | |
71 | 69 | | |
| |||
1441 | 1439 | | |
1442 | 1440 | | |
1443 | 1441 | | |
1444 | | - | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
1453 | | - | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
1454 | 1466 | | |
1455 | 1467 | | |
1456 | 1468 | | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
1460 | 1483 | | |
1461 | 1484 | | |
1462 | 1485 | | |
| |||
0 commit comments