Skip to content

perf(apollo-vertex): scope group-member query to requested group ids - #1023

Merged
frankkluijtmans merged 1 commit into
mainfrom
frankkluijtmans/query-group-by-id
Aug 7, 2026
Merged

perf(apollo-vertex): scope group-member query to requested group ids#1023
frankkluijtmans merged 1 commit into
mainfrom
frankkluijtmans/query-group-by-id

Conversation

@frankkluijtmans

@frankkluijtmans frankkluijtmans commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Both useIsGroupMember (used by GroupMembershipGuard) and useGroupMembers previously pulled the entire groupMembers collection and filtered client-side, which overloads the query as the collection grows. They now push the filter into the live query via .where(): useIsGroupMember uses inArray(members.groupId, groupIds) and useGroupMembers uses eq(members.groupId, groupId), so only members of the requested group(s) are fetched. The @tanstack/react-db type stub in optional-deps.d.ts gained a .where() method plus the eq and inArray operators to support this. This depends on the upstream groupMembers collection translating the predicate into a server-side filtered fetch.

👨 Generated with Kluijt Code

Copilot AI review requested due to automatic review settings August 6, 2026 13:31
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Apollo Coded App preview deployments are ready.

Project Status Preview Updated (PT)
apollo-design Ready Preview · Logs Aug 07, 2026, 01:13:20 AM
apollo-docs Ready Preview · Logs Aug 07, 2026, 01:13:20 AM
apollo-landing Ready Preview · Logs Aug 07, 2026, 01:13:20 AM
apollo-vertex Ready Preview · Logs Aug 07, 2026, 01:13:20 AM

@github-actions github-actions Bot added the size:S 10-29 changed lines. label Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Dependency License Review

  • 1950 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1720
ISC 89
Apache-2.0 55
BSD-3-Clause 27
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.3.2 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package bundle size on this PR (no JS/TS source changes detected under packages/* or web-packages/*).

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core
@uipath/apollo-react
@uipath/apollo-wind
@uipath/ap-chat

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

@frankkluijtmans
frankkluijtmans marked this pull request as ready for review August 6, 2026 13:34
@frankkluijtmans
frankkluijtmans requested a review from a team as a code owner August 6, 2026 13:34
@frankkluijtmans
frankkluijtmans enabled auto-merge (rebase) August 6, 2026 13:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves apps/apollo-vertex group-membership checks by pushing the groupIds filter into the @tanstack/react-db live query (instead of fetching the full groupMembers collection and filtering client-side), reducing query load as the collection grows.

Changes:

  • Added .where() support and an inArray() filter operator to the local @tanstack/react-db type stub.
  • Updated useIsGroupMember to apply a server-side groupId IN (...) filter and simplified the client-side membership check to only compare the user email.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
apps/apollo-vertex/types/optional-deps.d.ts Extends the @tanstack/react-db ambient type stub with .where() and inArray() to support filtered live queries.
apps/apollo-vertex/registry/shell/use-is-group-member.ts Applies a .where(inArray(...)) filter to only fetch members for the requested groups, then checks for the current user’s email in the returned rows.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Storybook visual diff

✅ No stories are affected by this PR's changes; nothing to compare. Logs

Updated (PT): Aug 07, 2026, 01:13:56 AM

Copilot AI review requested due to automatic review settings August 7, 2026 08:05
@frankkluijtmans
frankkluijtmans force-pushed the frankkluijtmans/query-group-by-id branch from eefbffa to 171db82 Compare August 7, 2026 08:05
@github-actions github-actions Bot removed the size:S 10-29 changed lines. label Aug 7, 2026
@github-actions github-actions Bot added the size:M 30-99 changed lines. label Aug 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

@frankkluijtmans
frankkluijtmans merged commit cb153ff into main Aug 7, 2026
55 of 57 checks passed
@frankkluijtmans
frankkluijtmans deleted the frankkluijtmans/query-group-by-id branch August 7, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:apollo-vertex size:M 30-99 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants